Play Strawberry Belgeler
Başvuru

Bu sayfa İngilizce gösteriliyor.

java-dialogs

Java dialog bodies, inputs, actions, links, and buttons.

Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.

How to use it: guide.

WIT declarations

text
use text.{text-component};
use item-stack.{item-stack};

enum dialog-type {
    notice,
    confirmation,
    multi-action,
    dialog-list,
    server-links,
}

variant dialog-body {
    plain-message(text-component),
    item(item-stack),
}

variant dialog-input {
    %bool(dialog-input-bool),
    %text(dialog-input-text),
    number-range(dialog-input-number-range),
    single-option(dialog-input-single-option),
}

record dialog-input-bool {
    label: text-component,
    default-value: bool,
}

record dialog-input-text {
    label: text-component,
    placeholder: text-component,
    default-value: string,
}

record dialog-input-number-range {
    label: text-component,
    min-value: f32,
    max-value: f32,
    initial-value: f32,
    step: f32,
    label-format: option<string>,
}

record dialog-input-single-option {
    label: text-component,
    options: list<text-component>,
    initial-index: u32,
}

enum after-action {
    peek,
    pop,
}

record action-button {
    text: text-component,
    tooltip: option<text-component>,
    width: option<u32>,
    action: action,
}

variant action {
    open-url(string),
    custom-click(custom-click-action),
}

record custom-click-action {
    id: string,
    payload: option<list<u8>>,
}

record link {
    label: link-label,
    url: string,
}

variant link-label {
    built-in(link-type),
    custom(text-component),
}

enum link-type {
    bug-report,
    community-guidelines,
    support,
    status,
    feedback,
    community,
    website,
    forums,
    news,
    announcements,
}

record dialog {
    title: text-component,
    %type: dialog-type,
    body: list<dialog-body>,
    inputs: list<dialog-input>,
    buttons: list<action-button>,
    links: list<link>,
    after-action: option<after-action>,
    can-close-with-escape: bool,
    external-title: option<text-component>,
}

record dialog-extras {
    text-max-lengths: list<tuple<u32, u32>>,
    button-images: list<tuple<u32, string>>,
}

record key-dialog {
    name: string,
    dialog: dialog,
    quick-actions: bool,
    pause-screen: bool,
}

set-key-dialogs: func(dialogs: list<key-dialog>) -> result<list<string>, string>;

Bu sayfada