@k2b/ui 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/chat/ChatComposer.js +759 -570
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/inputs/ChoiceGroups.js +30 -18
- package/dist/browser/inputs/ChoiceGroups.js.map +1 -1
- package/dist/browser/inputs/Select.js +32 -19
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/SpecialInputs.js +54 -25
- package/dist/browser/inputs/SpecialInputs.js.map +1 -1
- package/dist/browser/inputs/choice.js +4 -1
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/inputs/dictation/Dictation.js +546 -0
- package/dist/browser/inputs/dictation/Dictation.js.map +1 -0
- package/dist/browser/inputs/dictation/create-dictation.js +324 -0
- package/dist/browser/inputs/dictation/create-dictation.js.map +1 -0
- package/dist/browser/inputs/dictation/dictation-messages.js +115 -0
- package/dist/browser/inputs/dictation/dictation-messages.js.map +1 -0
- package/dist/browser/inputs/dictation/text-dictation.js +152 -0
- package/dist/browser/inputs/dictation/text-dictation.js.map +1 -0
- package/dist/browser/inputs/dictation/types.js +2 -0
- package/dist/browser/inputs/dictation/types.js.map +1 -0
- package/dist/browser/inputs/icon-messages.js +29 -2
- package/dist/browser/inputs/icon-messages.js.map +1 -1
- package/dist/browser/inputs/icon-texts.js +172 -0
- package/dist/browser/inputs/icon-texts.js.map +1 -0
- package/dist/browser/inputs/index.js +2 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/layout/AnchoredPopover.js +1 -1
- package/dist/browser/layout/AnchoredPopover.js.map +1 -1
- package/dist/browser/layout/SettingsModal.js +10 -5
- package/dist/browser/layout/SettingsModal.js.map +1 -1
- package/dist/browser/text-editor/TextEditor.js +74 -25
- package/dist/browser/text-editor/TextEditor.js.map +1 -1
- package/dist/browser/text-editor/dictation.js +166 -0
- package/dist/browser/text-editor/dictation.js.map +1 -0
- package/dist/browser/text-editor.js +1 -0
- package/dist/browser/text-editor.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +271 -99
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/inputs/ChoiceGroups.js +12 -3
- package/dist/ssr/inputs/ChoiceGroups.js.map +1 -1
- package/dist/ssr/inputs/Select.js +8 -2
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/SpecialInputs.js +54 -25
- package/dist/ssr/inputs/SpecialInputs.js.map +1 -1
- package/dist/ssr/inputs/choice.js +4 -1
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/inputs/dictation/Dictation.js +386 -0
- package/dist/ssr/inputs/dictation/Dictation.js.map +1 -0
- package/dist/ssr/inputs/dictation/create-dictation.js +324 -0
- package/dist/ssr/inputs/dictation/create-dictation.js.map +1 -0
- package/dist/ssr/inputs/dictation/dictation-messages.js +115 -0
- package/dist/ssr/inputs/dictation/dictation-messages.js.map +1 -0
- package/dist/ssr/inputs/dictation/text-dictation.js +152 -0
- package/dist/ssr/inputs/dictation/text-dictation.js.map +1 -0
- package/dist/ssr/inputs/dictation/types.js +2 -0
- package/dist/ssr/inputs/dictation/types.js.map +1 -0
- package/dist/ssr/inputs/icon-messages.js +29 -2
- package/dist/ssr/inputs/icon-messages.js.map +1 -1
- package/dist/ssr/inputs/icon-texts.js +172 -0
- package/dist/ssr/inputs/icon-texts.js.map +1 -0
- package/dist/ssr/inputs/index.js +2 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/layout/AnchoredPopover.js +1 -1
- package/dist/ssr/layout/AnchoredPopover.js.map +1 -1
- package/dist/ssr/layout/SettingsModal.js +10 -5
- package/dist/ssr/layout/SettingsModal.js.map +1 -1
- package/dist/ssr/text-editor/TextEditor.js +74 -25
- package/dist/ssr/text-editor/TextEditor.js.map +1 -1
- package/dist/ssr/text-editor/dictation.js +166 -0
- package/dist/ssr/text-editor/dictation.js.map +1 -0
- package/dist/ssr/text-editor.js +1 -0
- package/dist/ssr/text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/ChatComposer.d.ts +9 -0
- package/dist/types/inputs/SpecialInputs.d.ts +8 -0
- package/dist/types/inputs/dictation/Dictation.d.ts +26 -0
- package/dist/types/inputs/dictation/create-dictation.d.ts +77 -0
- package/dist/types/inputs/dictation/dictation-messages.d.ts +54 -0
- package/dist/types/inputs/dictation/text-dictation.d.ts +36 -0
- package/dist/types/inputs/dictation/types.d.ts +74 -0
- package/dist/types/inputs/icon-messages.d.ts +14 -0
- package/dist/types/inputs/icon-texts.d.ts +13 -0
- package/dist/types/inputs/index.d.ts +5 -0
- package/dist/types/layout/AnchoredPopover.d.ts +5 -0
- package/dist/types/text-editor/TextEditor.d.ts +10 -1
- package/dist/types/text-editor/dictation.d.ts +20 -0
- package/dist/types/text-editor.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/dictation/text-dictation.ts"],"sourcesContent":["/**\n * Dictation into plain text, such as a textarea: a mark where the next words land and the ranges dictation inserted.\n * Both follow edits the person makes anywhere else, so typing elsewhere never moves the dictated text.\n */\nexport type TextDictationState = {\n mark: number;\n /** Inserted ranges, as UTF-16 offsets into the current text, in order. */\n ranges: readonly (readonly [number, number])[];\n /** Whether the next insert is the first of a session, which adjusts the space before it. */\n fresh: boolean;\n};\n\nexport const beginTextDictation = (mark: number): TextDictationState => ({ mark, ranges: [], fresh: true });\n\n/** Where `offset` lands after `previous` became `next`; `after` keeps it behind text inserted exactly at it. */\nexport const mapTextOffset = (previous: string, next: string, offset: number, after: boolean): number => {\n if (previous === next) return offset;\n const limit = Math.min(previous.length, next.length);\n let start = 0;\n while (start < limit && previous[start] === next[start]) start++;\n let tail = 0;\n while (tail < limit - start && previous[previous.length - 1 - tail] === next[next.length - 1 - tail]) tail++;\n const oldEnd = previous.length - tail;\n const newEnd = next.length - tail;\n // Before the change, or exactly at its start and asked to stay before it.\n if (offset < start || (offset === start && !after)) return offset;\n if (offset >= oldEnd) return offset + (newEnd - oldEnd);\n // Inside a replaced stretch: to its new start or end.\n return after ? newEnd : start;\n};\n\n/** Follow an edit that dictation did not make. Ranges that the edit removed entirely disappear. */\nexport const mapTextDictation = (state: TextDictationState, previous: string, next: string): TextDictationState => {\n if (previous === next) return state;\n const ranges: [number, number][] = [];\n for (const [from, to] of state.ranges) {\n const start = mapTextOffset(previous, next, from, true);\n const end = Math.max(start, mapTextOffset(previous, next, to, false));\n if (end > start) ranges.push([start, end]);\n }\n return { ...state, mark: mapTextOffset(previous, next, state.mark, true), ranges };\n};\n\nconst space = /\\s/;\n\n/** Append `text` at the mark. The first words of a session get one space from earlier text, never two. */\nexport const insertTextDictation = (\n state: TextDictationState,\n value: string,\n text: string,\n): { state: TextDictationState; value: string } => {\n const mark = Math.min(state.mark, value.length);\n let chunk = text;\n /** A space after the first words when they land right before existing text; the mark stays before it. */\n let gap = \"\";\n if (state.fresh) {\n const before = value[mark - 1];\n if (before === undefined || space.test(before)) chunk = chunk.replace(/^[^\\S\\n]+/, \"\");\n else if (chunk && !space.test(chunk[0]!)) chunk = ` ${chunk}`;\n const after = value[mark];\n if (chunk && after !== undefined && !space.test(after) && !space.test(chunk[chunk.length - 1]!)) gap = \" \";\n }\n if (!chunk) return { state: { ...state, fresh: state.fresh && !text }, value };\n const length = chunk.length + gap.length;\n const ranges: [number, number][] = [];\n let joined = false;\n for (const [from, to] of state.ranges) {\n if (from > mark) ranges.push([from + length, to + length]);\n else if (to >= mark && !joined) {\n // The range around the mark grows by the new words.\n ranges.push([from, to + length]);\n joined = true;\n } else ranges.push([from, to]);\n }\n if (!joined) {\n ranges.push([mark, mark + length]);\n ranges.sort((a, b) => a[0] - b[0]);\n }\n return {\n state: { mark: mark + chunk.length, ranges, fresh: false },\n value: value.slice(0, mark) + chunk + gap + value.slice(mark),\n };\n};\n\n/** Remove every dictated range; text that was there before stays. */\nexport const discardTextDictation = (state: TextDictationState, value: string): { value: string; caret: number } => {\n let next = value;\n let caret = state.mark;\n for (const [from, to] of [...state.ranges].sort((a, b) => b[0] - a[0])) {\n next = next.slice(0, from) + next.slice(to);\n if (caret >= to) caret -= to - from;\n else if (caret > from) caret = from;\n }\n return { value: next, caret: Math.min(caret, next.length) };\n};\n\n/**\n * Split highlight segments of a field's text at the newest dictated words and the mark, for an overlay that tints the\n * fresh words and shows where the next ones land. A mark arrives as an empty segment.\n */\nexport const splitDictationSegments = <T extends { text: string }>(\n segments: readonly T[],\n fresh: readonly (readonly [number, number])[],\n mark: number | undefined,\n): (T & { fresh?: boolean; mark?: boolean })[] => {\n const result: (T & { fresh?: boolean; mark?: boolean })[] = [];\n let offset = 0;\n let marked = mark === undefined;\n for (const segment of segments) {\n const end = offset + segment.text.length;\n const cuts = new Set([offset, end]);\n for (const [from, to] of fresh) {\n if (from > offset && from < end) cuts.add(from);\n if (to > offset && to < end) cuts.add(to);\n }\n if (!marked && mark! > offset && mark! < end) cuts.add(mark!);\n const points = [...cuts].sort((a, b) => a - b);\n for (let index = 0; index < points.length; index++) {\n const from = points[index]!;\n if (!marked && mark === from) {\n result.push({ ...segment, text: \"\", mark: true });\n marked = true;\n }\n const to = points[index + 1];\n if (to === undefined) break;\n const isFresh = fresh.some(([start, stop]) => start <= from && to <= stop);\n result.push({ ...segment, text: segment.text.slice(from - offset, to - offset), ...(isFresh ? { fresh: true } : {}) });\n }\n offset = end;\n }\n if (!marked) result.push({ ...(segments[segments.length - 1] ?? ({ text: \"\" } as T)), text: \"\", mark: true });\n return result;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AASA,OAAO,MAAM,kBAAkB,GAAI,IAAY,KAA0B;EAAE,IAAI;EAAE,MAAM,EAAE,EAAE;EAAE,KAAK,EAAE;AAAK,CAAC,CAAC;;AAE3G;AACA,OAAO,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAE,MAAc,EAAE,KA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d;EACA,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;IAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAK;MAAE,IAAI,EAAE;IAAG,CAAO,CAAC;IAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE;EAAK,CAAC,CAAC;EAC7G,OAAO,MAAM;AACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/dictation/types.ts"],"sourcesContent":["/**\n * A speech-to-text stream as dictation consumes it. The library knows no server: an application passes a source, such\n * as one that relays the microphone to a speech model, and a target that places the text.\n */\nexport type DictationErrorCode =\n | \"not_configured\"\n | \"no_access\"\n | \"daily_limit\"\n | \"overloaded\"\n | \"busy_elsewhere\"\n | \"provider_failed\"\n | \"connection_lost\"\n | \"microphone_blocked\"\n | \"microphone_unavailable\";\n\nexport type DictationDevice = { id: string; label: string };\n\n/** Why a session ended on its own; the text so far stays. */\nexport type DictationEndReason = \"max_duration\" | \"silence\" | \"daily_limit\";\n\nexport type DictationEvent =\n | { type: \"state\"; state: \"connecting\" }\n | { type: \"state\"; state: \"live\"; maxMs: number; device?: DictationDevice }\n | { type: \"state\"; state: \"finishing\" }\n | { type: \"state\"; state: \"finished\"; reason?: DictationEndReason }\n /** 0 to 1, about every 100 ms while live. */\n | { type: \"level\"; level: number }\n /** New text to append at the dictation mark; earlier text is never revised. */\n | { type: \"text\"; text: string }\n | { type: \"error\"; code: DictationErrorCode; retryable: boolean; resetsAt?: string };\n\nexport type DictationSession = {\n /** Ends after `finished` or `error`, or without further events once the start signal aborted. */\n events: AsyncIterable<DictationEvent>;\n /** Regular stop: resolves after `finished` or an error, so the last words arrive before it. */\n stop(): Promise<void>;\n};\n\nexport type DictationSource = {\n /** Aborting `signal` closes the microphone and the connection at once, for discarding or leaving the page. */\n start(options: { deviceId?: string; signal: AbortSignal }): DictationSession;\n /** Microphones with their names; names may be empty before the first permission. */\n devices(): Promise<DictationDevice[]>;\n};\n\n/**\n * Where dictated text lands. `begin` starts each session: the first one remembers the insertion point, later ones of\n * the same dictation write on at it. `insert` appends at the mark, `discard` removes exactly the inserted text, and\n * `end` closes the dictation; the text stays.\n */\nexport type DictationTarget = {\n begin(): void;\n insert(text: string): void;\n discard(): void;\n end(): void;\n};\n\n/** A second way out when live dictation is busy, such as recording instead, with what it changes. */\nexport type DictationAlternative = { label: string; note: string; run: () => void };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -5,15 +5,42 @@ const iconMessages = i18n.define({
|
|
|
5
5
|
messages: {
|
|
6
6
|
en: {
|
|
7
7
|
filterIcons: "Filter icons",
|
|
8
|
-
pickIcon: "Pick an icon..."
|
|
8
|
+
pickIcon: "Pick an icon...",
|
|
9
|
+
recommended: "Recommended",
|
|
10
|
+
people: "People",
|
|
11
|
+
work: "Work",
|
|
12
|
+
communication: "Communication",
|
|
13
|
+
files: "Files",
|
|
14
|
+
data: "Data & tech",
|
|
15
|
+
commerce: "Commerce",
|
|
16
|
+
places: "Places",
|
|
17
|
+
food: "Food",
|
|
18
|
+
media: "Media",
|
|
19
|
+
devices: "Devices"
|
|
9
20
|
},
|
|
10
21
|
de: {
|
|
11
22
|
filterIcons: "Symbole filtern",
|
|
12
|
-
pickIcon: "Symbol auswählen..."
|
|
23
|
+
pickIcon: "Symbol auswählen...",
|
|
24
|
+
recommended: "Empfohlen",
|
|
25
|
+
people: "Personen",
|
|
26
|
+
work: "Arbeit",
|
|
27
|
+
communication: "Kommunikation",
|
|
28
|
+
files: "Dateien",
|
|
29
|
+
data: "Daten & Technik",
|
|
30
|
+
commerce: "Handel",
|
|
31
|
+
places: "Orte",
|
|
32
|
+
food: "Essen",
|
|
33
|
+
media: "Medien",
|
|
34
|
+
devices: "Geräte"
|
|
13
35
|
}
|
|
14
36
|
}
|
|
15
37
|
});
|
|
16
38
|
/** Resolved from the inherited render locale. */
|
|
39
|
+
/** The catalog locale the render locale resolves to, such as "de" for "de-AT". */
|
|
40
|
+
export const useIconLocale = () => {
|
|
41
|
+
const locale = useLocale();
|
|
42
|
+
return () => iconMessages.resolve([locale()]).locale;
|
|
43
|
+
};
|
|
17
44
|
export const useIconMessages = () => {
|
|
18
45
|
const locale = useLocale();
|
|
19
46
|
return () => iconMessages.resolve([locale()]).t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/icon-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst iconMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n filterIcons: \"Filter icons\",\n pickIcon: \"Pick an icon...\",\n },\n de: {\n filterIcons: \"Symbole filtern\",\n pickIcon: \"Symbol auswählen...\",\n },\n },\n});\n\nexport type IconMessages = ReturnType<(typeof iconMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useIconMessages = (): (() => IconMessages) => {\n const locale = useLocale();\n return () => iconMessages.resolve([locale()]).t;\n};\n\nexport const checkIconMessages = () => iconMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;EAC/B,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,WAAW,EAAE,cAAc;MAC3B,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/icon-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst iconMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n filterIcons: \"Filter icons\",\n pickIcon: \"Pick an icon...\",\n recommended: \"Recommended\",\n people: \"People\",\n work: \"Work\",\n communication: \"Communication\",\n files: \"Files\",\n data: \"Data & tech\",\n commerce: \"Commerce\",\n places: \"Places\",\n food: \"Food\",\n media: \"Media\",\n devices: \"Devices\",\n },\n de: {\n filterIcons: \"Symbole filtern\",\n pickIcon: \"Symbol auswählen...\",\n recommended: \"Empfohlen\",\n people: \"Personen\",\n work: \"Arbeit\",\n communication: \"Kommunikation\",\n files: \"Dateien\",\n data: \"Daten & Technik\",\n commerce: \"Handel\",\n places: \"Orte\",\n food: \"Essen\",\n media: \"Medien\",\n devices: \"Geräte\",\n },\n },\n});\n\nexport type IconMessages = ReturnType<(typeof iconMessages)[\"resolve\"]>[\"t\"];\n\nexport type IconGroupMessage = keyof Omit<IconMessages, \"filterIcons\" | \"pickIcon\">;\n\n/** Resolved from the inherited render locale. */\n/** The catalog locale the render locale resolves to, such as \"de\" for \"de-AT\". */\nexport const useIconLocale = (): (() => string) => {\n const locale = useLocale();\n return () => iconMessages.resolve([locale()]).locale;\n};\n\nexport const useIconMessages = (): (() => IconMessages) => {\n const locale = useLocale();\n return () => iconMessages.resolve([locale()]).t;\n};\n\nexport const checkIconMessages = () => iconMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;EAC/B,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,WAAW,EAAE,cAAc;MAC3B,QAAQ,EAAE,iBAAiB;MAC3B,WAAW,EAAE,aAAa;MAC1B,MAAM,EAAE,QAAQ;MAChB,IAAI,EAAE,MAAM;MACZ,aAAa,EAAE,eAAe;MAC9B,KAAK,EAAE,OAAO;MACd,IAAI,EAAE,aAAa;MACnB,QAAQ,EAAE,UAAU;MACpB,MAAM,EAAE,QAAQ;MAChB,IAAI,EAAE,MAAM;MACZ,KAAK,EAAE,OAAO;MACd,OAAO,EAAE;IACX,CAAC;IACD,EAAE,EAAE;MACF,WAAW,EAAE,iBAAiB;MAC9B,QAAQ,EAAE,qBAAqB;MAC/B,WAAW,EAAE,WAAW;MACxB,MAAM,EAAE,UAAU;MAClB,IAAI,EAAE,QAAQ;MACd,aAAa,EAAE,eAAe;MAC9B,KAAK,EAAE,SAAS;MAChB,IAAI,EAAE,iBAAiB;MACvB,QAAQ,EAAE,QAAQ;MAClB,MAAM,EAAE,MAAM;MACd,IAAI,EAAE,OAAO;MACb,KAAK,EAAE,QAAQ;MACf,OAAO,EAAE;IACX;EACF;AACF,CAAC,CAAC;AAMF;AACA;AACA,OAAO,MAAM,aAAa,GAAG,MAAsB;EACjD,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;AACtD,CAAC;AAED,OAAO,MAAM,eAAe,GAAG,MAA4B;EACzD,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,OAAO,MAAM,iBAAiB,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { DEFAULT_ICON_OPTIONS } from "./icon-options";
|
|
2
|
+
/**
|
|
3
|
+
* German names for the default catalogue, keyed by the Tabler glyph name.
|
|
4
|
+
* Keywords are extra German search words; the English label and keywords stay
|
|
5
|
+
* searchable in every locale. This is catalogue data, not UI messages: the
|
|
6
|
+
* locale itself resolves through the icon message catalog, and
|
|
7
|
+
* `icon-options.test.ts` keeps the table complete.
|
|
8
|
+
*/
|
|
9
|
+
export const GERMAN_ICON_TEXTS = {
|
|
10
|
+
activity: ["Aktivität", "Live-Aktivität oder Zustandssignale", "puls überwachung"],
|
|
11
|
+
adjustments: ["Regler", "Einstellungen oder Steuerung anpassen", "einstellungen steuerung"],
|
|
12
|
+
"alert-circle": ["Warnung", "Wichtiger Hinweis oder ein Problem", "fehler achtung"],
|
|
13
|
+
archive: ["Archiv", "Abgelegtes oder inaktives Material", "ablage kiste"],
|
|
14
|
+
bell: ["Glocke", "Benachrichtigungen und Erinnerungen", "benachrichtigung erinnerung"],
|
|
15
|
+
book: ["Buch", "Lesen, Wissen oder eine Bibliothek", "lesen bibliothek wissen"],
|
|
16
|
+
bookmark: ["Lesezeichen", "Für später gespeicherte Inhalte", "merken favorit"],
|
|
17
|
+
box: ["Kiste", "Ein Produkt, Paket oder Behälter", "paket lager karton"],
|
|
18
|
+
briefcase: ["Aktentasche", "Geschäft, Job oder Projekt", "geschäft arbeit projekt"],
|
|
19
|
+
building: ["Gebäude", "Eine Organisation oder ein Büro", "firma büro unternehmen"],
|
|
20
|
+
calendar: ["Kalender", "Termine, Pläne und Zeitpläne", "datum termin plan"],
|
|
21
|
+
camera: ["Kamera", "Fotografie oder Bildaufnahme", "foto bild"],
|
|
22
|
+
"chart-bar": ["Balkendiagramm", "Werte über Kategorien vergleichen", "statistik auswertung diagramm"],
|
|
23
|
+
"chart-line": ["Liniendiagramm", "Einen Verlauf über die Zeit zeigen", "statistik trend diagramm"],
|
|
24
|
+
check: ["Haken", "Eine erledigte oder bestätigte Aktion", "erledigt fertig ok"],
|
|
25
|
+
"circle-check": ["Haken im Kreis", "Erfolgreicher oder genehmigter Status", "erledigt erfolg genehmigt"],
|
|
26
|
+
clock: ["Uhr", "Zeit, Dauer oder eine Frist", "zeit dauer frist"],
|
|
27
|
+
cloud: ["Wolke", "Gehostete oder synchronisierte Dienste", "online synchronisation hosting"],
|
|
28
|
+
heart: ["Herz", "Favorit, Gefällt mir oder Gesundheit", "favorit liebe gesundheit"],
|
|
29
|
+
home: ["Haus", "Eine Startseite oder ein Zuhause", "start zuhause startseite"],
|
|
30
|
+
"layout-dashboard": ["Dashboard", "Eine Übersicht oder Steuerzentrale", "übersicht layout"],
|
|
31
|
+
search: ["Suche", "Inhalte oder Einträge finden", "suchen finden lupe"],
|
|
32
|
+
settings: ["Einstellungen", "Konfiguration und Vorlieben", "zahnrad konfiguration"],
|
|
33
|
+
sparkles: ["Funkeln", "KI, Magie oder etwas Neues", "ki magie neu"],
|
|
34
|
+
star: ["Stern", "Favorit, Bewertung oder Hervorhebung", "favorit bewertung"],
|
|
35
|
+
tag: ["Etikett", "Eine Markierung oder Kategorie", "schlagwort kategorie label"],
|
|
36
|
+
cube: ["Würfel", "Ein Modul, Objekt oder Baustein", "modul komponente baustein"],
|
|
37
|
+
download: ["Herunterladen", "Eine Datei speichern oder exportieren", "speichern export download"],
|
|
38
|
+
"external-link": ["Externer Link", "Eine andere Seite oder Website öffnen", "öffnen neuer tab"],
|
|
39
|
+
eye: ["Auge", "Ansehen, Vorschau oder Sichtbarkeit", "ansicht vorschau sichtbar"],
|
|
40
|
+
"help-circle": ["Hilfe", "Hilfe, Support oder eine Frage", "frage support"],
|
|
41
|
+
"info-circle": ["Info", "Zusätzliche Informationen oder Hinweise", "information hinweis"],
|
|
42
|
+
key: ["Schlüssel", "Zugang, Zugangsdaten oder Sicherheit", "zugang sicherheit passwort"],
|
|
43
|
+
link: ["Link", "Eine URL oder Verbindung", "verknüpfung verbindung adresse"],
|
|
44
|
+
list: ["Liste", "Eine Folge von Einträgen oder Zeilen", "einträge zeilen aufzählung"],
|
|
45
|
+
lock: ["Schloss", "Private oder geschützte Inhalte", "sicherheit privat gesperrt"],
|
|
46
|
+
package: ["Paket", "Eine Sendung oder ein Softwaremodul", "sendung modul"],
|
|
47
|
+
plus: ["Plus", "Etwas hinzufügen oder erstellen", "hinzufügen neu erstellen"],
|
|
48
|
+
shield: ["Schild", "Sicherheit oder Schutz", "sicherheit schutz"],
|
|
49
|
+
trash: ["Papierkorb", "Etwas löschen oder entfernen", "löschen entfernen mülleimer"],
|
|
50
|
+
upload: ["Hochladen", "Eine Datei importieren oder senden", "import datei hochladen"],
|
|
51
|
+
x: ["Schließen", "Schließen, abbrechen oder entfernen", "abbrechen entfernen kreuz"],
|
|
52
|
+
"address-book": ["Adressbuch", "Gespeicherte Personen und Kontaktdaten", "kontakte verzeichnis"],
|
|
53
|
+
friends: ["Freunde", "Freunde oder ein sozialer Kreis", "sozial gruppe"],
|
|
54
|
+
id: ["Ausweis", "Identität oder Kontodaten", "identität ausweis"],
|
|
55
|
+
"mood-smile": ["Lächeln", "Gute Stimmung oder Feedback", "fröhlich emoji"],
|
|
56
|
+
user: ["Person", "Eine Person oder ein Konto", "benutzer konto nutzer"],
|
|
57
|
+
"user-check": ["Bestätigte Person", "Eine genehmigte oder verifizierte Person", "genehmigt verifiziert"],
|
|
58
|
+
"user-circle": ["Profil", "Ein persönliches Profil oder Avatar", "profil avatar benutzer"],
|
|
59
|
+
"user-plus": ["Person hinzufügen", "Eine Person einladen oder hinzufügen", "einladen beitreten"],
|
|
60
|
+
users: ["Personen", "Eine Gruppe, ein Team oder Publikum", "gruppe team leute"],
|
|
61
|
+
award: ["Auszeichnung", "Eine Leistung oder Anerkennung", "medaille preis"],
|
|
62
|
+
"building-store": ["Laden", "Ein Geschäft oder eine Filiale", "geschäft einzelhandel"],
|
|
63
|
+
clipboard: ["Zwischenablage", "Kopierte Inhalte oder eine Aufgabe", "kopieren einfügen"],
|
|
64
|
+
"clipboard-list": ["Aufgabenliste", "Eine Checkliste oder Aufgaben", "aufgaben checkliste todo"],
|
|
65
|
+
edit: ["Bearbeiten", "Bestehende Inhalte ändern", "stift ändern"],
|
|
66
|
+
filter: ["Filter", "Ergebnisse eingrenzen", "eingrenzen suchen"],
|
|
67
|
+
flag: ["Flagge", "Eine Markierung, ein Meilenstein oder eine Meldung", "markierung meilenstein"],
|
|
68
|
+
presentation: ["Präsentation", "Folien oder ein Vortrag", "folien vortrag"],
|
|
69
|
+
printer: ["Drucker", "Eine Papierkopie drucken", "drucken papier"],
|
|
70
|
+
school: ["Schule", "Bildung, Schulung oder ein Campus", "bildung lernen"],
|
|
71
|
+
target: ["Ziel", "Ein Ziel oder eine Vorgabe", "zielscheibe"],
|
|
72
|
+
tool: ["Werkzeug", "Wartung oder praktische Arbeit", "wartung schraubenschlüssel"],
|
|
73
|
+
trophy: ["Pokal", "Ein Sieg oder großer Erfolg", "sieger gewinner"],
|
|
74
|
+
file: ["Datei", "Eine allgemeine Datei oder ein Dokument", "dokument"],
|
|
75
|
+
"file-code": ["Code-Datei", "Quellcode oder ein Skript", "quellcode skript"],
|
|
76
|
+
"file-spreadsheet": ["Tabellendokument", "Tabellendaten oder eine Arbeitsmappe", "tabellenkalkulation arbeitsmappe"],
|
|
77
|
+
"file-text": ["Dokument", "Text oder Dokumentation", "text doku"],
|
|
78
|
+
files: ["Dateien", "Eine Sammlung von Dokumenten", "dokumente mehrere"],
|
|
79
|
+
folder: ["Ordner", "Ein Verzeichnis mit Dateien", "verzeichnis"],
|
|
80
|
+
"folder-open": ["Offener Ordner", "Ein gerade geöffnetes Verzeichnis", "verzeichnis durchsuchen"],
|
|
81
|
+
note: ["Notiz", "Eine kurze Notiz oder Anmerkung", "anmerkung schreiben"],
|
|
82
|
+
notebook: ["Notizbuch", "Notizen, Tagebuch oder Recherche", "tagebuch notizen schreiben"],
|
|
83
|
+
paperclip: ["Anhang", "Eine angehängte Datei", "anhängen büroklammer"],
|
|
84
|
+
pencil: ["Stift", "Schreiben oder Inhalte verfassen", "schreiben verfassen"],
|
|
85
|
+
api: ["API", "Eine Programmierschnittstelle", "schnittstelle dienst"],
|
|
86
|
+
"brand-github": ["GitHub", "Ein GitHub-Repository oder -Projekt", "repository code"],
|
|
87
|
+
browser: ["Browser", "Eine Website oder ein Webbrowser", "web internet webseite"],
|
|
88
|
+
bug: ["Fehler", "Ein Softwarefehler oder Mangel", "käfer problem"],
|
|
89
|
+
code: ["Code", "Programmierung oder Quellcode", "quellcode entwicklung"],
|
|
90
|
+
database: ["Datenbank", "Strukturierte Datenspeicherung", "speicher daten"],
|
|
91
|
+
"git-branch": ["Git-Branch", "Ein Zweig von Quelländerungen", "zweig repository"],
|
|
92
|
+
network: ["Netzwerk", "Verbundene Systeme oder Knoten", "verbindung knoten"],
|
|
93
|
+
robot: ["Roboter", "Automatisierung, ein Bot oder KI", "bot ki automatisierung"],
|
|
94
|
+
server: ["Server", "Ein Host oder Infrastrukturdienst", "infrastruktur rechner"],
|
|
95
|
+
table: ["Tabelle", "Zeilen und Spalten mit Daten", "raster spalten zeilen"],
|
|
96
|
+
terminal: ["Terminal", "Eine Kommandozeile oder Shell", "konsole kommandozeile"],
|
|
97
|
+
wifi: ["WLAN", "Drahtloser Netzwerkzugang", "drahtlos internet"],
|
|
98
|
+
at: ["At-Zeichen", "Eine Erwähnung oder E-Mail-Adresse", "erwähnung email"],
|
|
99
|
+
mail: ["E-Mail", "E-Mail oder schriftliche Korrespondenz", "nachricht brief post"],
|
|
100
|
+
"mail-opened": ["Geöffnete E-Mail", "Eine gelesene oder geöffnete Nachricht", "gelesen nachricht"],
|
|
101
|
+
message: ["Nachricht", "Chat oder eine Unterhaltung", "chat kommentar"],
|
|
102
|
+
messages: ["Nachrichten", "Eine Unterhaltung mit mehreren Nachrichten", "chat unterhaltung"],
|
|
103
|
+
microphone: ["Mikrofon", "Spracheingabe oder Tonaufnahme", "audio stimme aufnahme"],
|
|
104
|
+
phone: ["Telefon", "Ein Anruf oder eine Telefonnummer", "anruf anrufen"],
|
|
105
|
+
send: ["Senden", "Eine Nachricht oder Einreichung zustellen", "abschicken zustellen"],
|
|
106
|
+
share: ["Teilen", "Inhalte an andere weitergeben", "weitergeben sozial"],
|
|
107
|
+
"building-bank": ["Bank", "Bankgeschäfte oder ein Finanzinstitut", "finanzen geld"],
|
|
108
|
+
calculator: ["Taschenrechner", "Berechnung oder Buchhaltung", "rechnen buchhaltung mathe"],
|
|
109
|
+
cash: ["Bargeld", "Bargeld oder eine Barzahlung", "geld geldschein"],
|
|
110
|
+
coin: ["Münze", "Geld, Währung oder Guthaben", "geld finanzen guthaben"],
|
|
111
|
+
"credit-card": ["Kreditkarte", "Kartenzahlungen und Abrechnung", "zahlung geld karte"],
|
|
112
|
+
"currency-dollar": ["Dollar", "Preise oder Beträge in Dollar", "währung geld"],
|
|
113
|
+
"currency-euro": ["Euro", "Preise oder Beträge in Euro", "währung geld"],
|
|
114
|
+
percentage: ["Prozent", "Ein Satz, Anteil oder Rabatt", "rabatt anteil"],
|
|
115
|
+
receipt: ["Beleg", "Ein Kauf, eine Rechnung oder Quittung", "rechnung quittung kassenbon"],
|
|
116
|
+
"shopping-bag": ["Einkaufstasche", "Einkaufen oder eine Bestellung", "einkaufen kaufen bestellung"],
|
|
117
|
+
"shopping-cart": ["Warenkorb", "Artikel zum Kaufen", "einkaufen kaufen"],
|
|
118
|
+
wallet: ["Geldbörse", "Geld, Karten oder ein Kontostand", "portemonnaie geld finanzen"],
|
|
119
|
+
bike: ["Fahrrad", "Radfahren oder Fahrradverkehr", "rad verkehr"],
|
|
120
|
+
bus: ["Bus", "Öffentlicher Straßenverkehr", "verkehr öffentlich"],
|
|
121
|
+
car: ["Auto", "Autofahren oder ein Fahrzeug", "fahrzeug wagen"],
|
|
122
|
+
compass: ["Kompass", "Richtung oder Navigation", "navigation richtung"],
|
|
123
|
+
map: ["Karte", "Geografie oder ein Gebietsüberblick", "ort geografie landkarte"],
|
|
124
|
+
"map-pin": ["Standort", "Ein bestimmter Ort oder eine Adresse", "ort adresse stecknadel"],
|
|
125
|
+
mountain: ["Berg", "Natur, draußen oder ein Gipfel", "natur gipfel draußen"],
|
|
126
|
+
plane: ["Flugzeug", "Flugreise oder ein Flug", "flug reise"],
|
|
127
|
+
rocket: ["Rakete", "Ein Start, Wachstum oder schneller Beginn", "start wachstum weltraum"],
|
|
128
|
+
route: ["Route", "Ein Weg, eine Reise oder ein Reiseplan", "weg reise"],
|
|
129
|
+
ship: ["Schiff", "Seeverkehr oder Versand", "boot see"],
|
|
130
|
+
tent: ["Zelt", "Camping oder ein Ort im Freien", "camping draußen"],
|
|
131
|
+
train: ["Zug", "Bahnreise oder öffentlicher Verkehr", "bahn verkehr"],
|
|
132
|
+
truck: ["Lastwagen", "Fracht, Logistik oder Lieferung", "lkw lieferung versand logistik"],
|
|
133
|
+
world: ["Welt", "Global, international oder Webinhalte", "globus erde web"],
|
|
134
|
+
apple: ["Apfel", "Obst, Essen oder gesunde Ernährung", "obst gesund"],
|
|
135
|
+
cake: ["Kuchen", "Nachtisch oder eine Feier", "torte geburtstag feier"],
|
|
136
|
+
"chef-hat": ["Kochmütze", "Kochen, Rezepte oder ein Restaurant", "kochen rezept restaurant"],
|
|
137
|
+
coffee: ["Kaffee", "Kaffee, ein Café oder eine Pause", "getränk café pause"],
|
|
138
|
+
cookie: ["Keks", "Ein Snack, Nachtisch oder Browser-Cookie", "plätzchen snack"],
|
|
139
|
+
glass: ["Glas", "Ein Getränk", "getränk wein"],
|
|
140
|
+
"ice-cream": ["Eis", "Ein gefrorener Nachtisch", "eiscreme nachtisch"],
|
|
141
|
+
lemon: ["Zitrone", "Zitrusfrucht oder ein frischer Geschmack", "obst zitrus"],
|
|
142
|
+
mug: ["Tasse", "Ein Heißgetränk oder Becher", "becher getränk"],
|
|
143
|
+
pizza: ["Pizza", "Essen, Lieferung oder ein Restaurant", "restaurant lieferung essen"],
|
|
144
|
+
headphones: ["Kopfhörer", "Musik oder Audio hören", "audio hören"],
|
|
145
|
+
music: ["Musik", "Lieder, Klang oder Audio", "lied audio"],
|
|
146
|
+
palette: ["Palette", "Farbe, Kunst oder visuelles Design", "farbe kunst design"],
|
|
147
|
+
photo: ["Foto", "Ein Bild", "bild"],
|
|
148
|
+
"player-pause": ["Pause", "Audio- oder Videowiedergabe pausieren", "anhalten wiedergabe"],
|
|
149
|
+
"player-play": ["Abspielen", "Audio- oder Videowiedergabe starten", "start wiedergabe"],
|
|
150
|
+
"player-stop": ["Stopp", "Audio- oder Videowiedergabe beenden", "beenden wiedergabe"],
|
|
151
|
+
video: ["Video", "Bewegte Bilder oder eine Aufnahme", "film kamera"],
|
|
152
|
+
volume: ["Lautstärke", "Ton oder Audiopegel", "ton audio laut"],
|
|
153
|
+
"device-desktop": ["Desktop", "Ein Desktop-Computer oder Monitor", "computer bildschirm rechner"],
|
|
154
|
+
"device-laptop": ["Laptop", "Ein tragbarer Computer", "computer notebook"],
|
|
155
|
+
"device-mobile": ["Handy", "Ein Smartphone oder die mobile Ansicht", "telefon smartphone mobil"],
|
|
156
|
+
"device-tablet": ["Tablet", "Ein Tablet oder die Tablet-Ansicht", "ipad computer"],
|
|
157
|
+
plug: ["Stecker", "Strom oder eine Systemverbindung", "strom verbinden"]
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** The default catalogue in a resolved locale; English is the catalogue itself. */
|
|
161
|
+
export const localizedIconOptions = locale => locale !== "de" ? DEFAULT_ICON_OPTIONS : DEFAULT_ICON_OPTIONS.map(option => {
|
|
162
|
+
const text = GERMAN_ICON_TEXTS[option.value.replace("ti ti-", "")];
|
|
163
|
+
if (!text) return option;
|
|
164
|
+
const [label, description, keywords] = text;
|
|
165
|
+
return {
|
|
166
|
+
...option,
|
|
167
|
+
label,
|
|
168
|
+
description,
|
|
169
|
+
keywords: [...(option.keywords ?? []), String(option.label), ...keywords.split(" ")]
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
//# sourceMappingURL=icon-texts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/icon-texts.ts"],"sourcesContent":["import { DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nimport type { IconOption } from \"./SpecialInputs\";\n\ntype IconText = readonly [label: string, description: string, keywords: string];\n\n/**\n * German names for the default catalogue, keyed by the Tabler glyph name.\n * Keywords are extra German search words; the English label and keywords stay\n * searchable in every locale. This is catalogue data, not UI messages: the\n * locale itself resolves through the icon message catalog, and\n * `icon-options.test.ts` keeps the table complete.\n */\nexport const GERMAN_ICON_TEXTS: Readonly<Record<string, IconText>> = {\n activity: [\"Aktivität\", \"Live-Aktivität oder Zustandssignale\", \"puls überwachung\"],\n adjustments: [\"Regler\", \"Einstellungen oder Steuerung anpassen\", \"einstellungen steuerung\"],\n \"alert-circle\": [\"Warnung\", \"Wichtiger Hinweis oder ein Problem\", \"fehler achtung\"],\n archive: [\"Archiv\", \"Abgelegtes oder inaktives Material\", \"ablage kiste\"],\n bell: [\"Glocke\", \"Benachrichtigungen und Erinnerungen\", \"benachrichtigung erinnerung\"],\n book: [\"Buch\", \"Lesen, Wissen oder eine Bibliothek\", \"lesen bibliothek wissen\"],\n bookmark: [\"Lesezeichen\", \"Für später gespeicherte Inhalte\", \"merken favorit\"],\n box: [\"Kiste\", \"Ein Produkt, Paket oder Behälter\", \"paket lager karton\"],\n briefcase: [\"Aktentasche\", \"Geschäft, Job oder Projekt\", \"geschäft arbeit projekt\"],\n building: [\"Gebäude\", \"Eine Organisation oder ein Büro\", \"firma büro unternehmen\"],\n calendar: [\"Kalender\", \"Termine, Pläne und Zeitpläne\", \"datum termin plan\"],\n camera: [\"Kamera\", \"Fotografie oder Bildaufnahme\", \"foto bild\"],\n \"chart-bar\": [\"Balkendiagramm\", \"Werte über Kategorien vergleichen\", \"statistik auswertung diagramm\"],\n \"chart-line\": [\"Liniendiagramm\", \"Einen Verlauf über die Zeit zeigen\", \"statistik trend diagramm\"],\n check: [\"Haken\", \"Eine erledigte oder bestätigte Aktion\", \"erledigt fertig ok\"],\n \"circle-check\": [\"Haken im Kreis\", \"Erfolgreicher oder genehmigter Status\", \"erledigt erfolg genehmigt\"],\n clock: [\"Uhr\", \"Zeit, Dauer oder eine Frist\", \"zeit dauer frist\"],\n cloud: [\"Wolke\", \"Gehostete oder synchronisierte Dienste\", \"online synchronisation hosting\"],\n heart: [\"Herz\", \"Favorit, Gefällt mir oder Gesundheit\", \"favorit liebe gesundheit\"],\n home: [\"Haus\", \"Eine Startseite oder ein Zuhause\", \"start zuhause startseite\"],\n \"layout-dashboard\": [\"Dashboard\", \"Eine Übersicht oder Steuerzentrale\", \"übersicht layout\"],\n search: [\"Suche\", \"Inhalte oder Einträge finden\", \"suchen finden lupe\"],\n settings: [\"Einstellungen\", \"Konfiguration und Vorlieben\", \"zahnrad konfiguration\"],\n sparkles: [\"Funkeln\", \"KI, Magie oder etwas Neues\", \"ki magie neu\"],\n star: [\"Stern\", \"Favorit, Bewertung oder Hervorhebung\", \"favorit bewertung\"],\n tag: [\"Etikett\", \"Eine Markierung oder Kategorie\", \"schlagwort kategorie label\"],\n cube: [\"Würfel\", \"Ein Modul, Objekt oder Baustein\", \"modul komponente baustein\"],\n download: [\"Herunterladen\", \"Eine Datei speichern oder exportieren\", \"speichern export download\"],\n \"external-link\": [\"Externer Link\", \"Eine andere Seite oder Website öffnen\", \"öffnen neuer tab\"],\n eye: [\"Auge\", \"Ansehen, Vorschau oder Sichtbarkeit\", \"ansicht vorschau sichtbar\"],\n \"help-circle\": [\"Hilfe\", \"Hilfe, Support oder eine Frage\", \"frage support\"],\n \"info-circle\": [\"Info\", \"Zusätzliche Informationen oder Hinweise\", \"information hinweis\"],\n key: [\"Schlüssel\", \"Zugang, Zugangsdaten oder Sicherheit\", \"zugang sicherheit passwort\"],\n link: [\"Link\", \"Eine URL oder Verbindung\", \"verknüpfung verbindung adresse\"],\n list: [\"Liste\", \"Eine Folge von Einträgen oder Zeilen\", \"einträge zeilen aufzählung\"],\n lock: [\"Schloss\", \"Private oder geschützte Inhalte\", \"sicherheit privat gesperrt\"],\n package: [\"Paket\", \"Eine Sendung oder ein Softwaremodul\", \"sendung modul\"],\n plus: [\"Plus\", \"Etwas hinzufügen oder erstellen\", \"hinzufügen neu erstellen\"],\n shield: [\"Schild\", \"Sicherheit oder Schutz\", \"sicherheit schutz\"],\n trash: [\"Papierkorb\", \"Etwas löschen oder entfernen\", \"löschen entfernen mülleimer\"],\n upload: [\"Hochladen\", \"Eine Datei importieren oder senden\", \"import datei hochladen\"],\n x: [\"Schließen\", \"Schließen, abbrechen oder entfernen\", \"abbrechen entfernen kreuz\"],\n\n \"address-book\": [\"Adressbuch\", \"Gespeicherte Personen und Kontaktdaten\", \"kontakte verzeichnis\"],\n friends: [\"Freunde\", \"Freunde oder ein sozialer Kreis\", \"sozial gruppe\"],\n id: [\"Ausweis\", \"Identität oder Kontodaten\", \"identität ausweis\"],\n \"mood-smile\": [\"Lächeln\", \"Gute Stimmung oder Feedback\", \"fröhlich emoji\"],\n user: [\"Person\", \"Eine Person oder ein Konto\", \"benutzer konto nutzer\"],\n \"user-check\": [\"Bestätigte Person\", \"Eine genehmigte oder verifizierte Person\", \"genehmigt verifiziert\"],\n \"user-circle\": [\"Profil\", \"Ein persönliches Profil oder Avatar\", \"profil avatar benutzer\"],\n \"user-plus\": [\"Person hinzufügen\", \"Eine Person einladen oder hinzufügen\", \"einladen beitreten\"],\n users: [\"Personen\", \"Eine Gruppe, ein Team oder Publikum\", \"gruppe team leute\"],\n\n award: [\"Auszeichnung\", \"Eine Leistung oder Anerkennung\", \"medaille preis\"],\n \"building-store\": [\"Laden\", \"Ein Geschäft oder eine Filiale\", \"geschäft einzelhandel\"],\n clipboard: [\"Zwischenablage\", \"Kopierte Inhalte oder eine Aufgabe\", \"kopieren einfügen\"],\n \"clipboard-list\": [\"Aufgabenliste\", \"Eine Checkliste oder Aufgaben\", \"aufgaben checkliste todo\"],\n edit: [\"Bearbeiten\", \"Bestehende Inhalte ändern\", \"stift ändern\"],\n filter: [\"Filter\", \"Ergebnisse eingrenzen\", \"eingrenzen suchen\"],\n flag: [\"Flagge\", \"Eine Markierung, ein Meilenstein oder eine Meldung\", \"markierung meilenstein\"],\n presentation: [\"Präsentation\", \"Folien oder ein Vortrag\", \"folien vortrag\"],\n printer: [\"Drucker\", \"Eine Papierkopie drucken\", \"drucken papier\"],\n school: [\"Schule\", \"Bildung, Schulung oder ein Campus\", \"bildung lernen\"],\n target: [\"Ziel\", \"Ein Ziel oder eine Vorgabe\", \"zielscheibe\"],\n tool: [\"Werkzeug\", \"Wartung oder praktische Arbeit\", \"wartung schraubenschlüssel\"],\n trophy: [\"Pokal\", \"Ein Sieg oder großer Erfolg\", \"sieger gewinner\"],\n\n file: [\"Datei\", \"Eine allgemeine Datei oder ein Dokument\", \"dokument\"],\n \"file-code\": [\"Code-Datei\", \"Quellcode oder ein Skript\", \"quellcode skript\"],\n \"file-spreadsheet\": [\"Tabellendokument\", \"Tabellendaten oder eine Arbeitsmappe\", \"tabellenkalkulation arbeitsmappe\"],\n \"file-text\": [\"Dokument\", \"Text oder Dokumentation\", \"text doku\"],\n files: [\"Dateien\", \"Eine Sammlung von Dokumenten\", \"dokumente mehrere\"],\n folder: [\"Ordner\", \"Ein Verzeichnis mit Dateien\", \"verzeichnis\"],\n \"folder-open\": [\"Offener Ordner\", \"Ein gerade geöffnetes Verzeichnis\", \"verzeichnis durchsuchen\"],\n note: [\"Notiz\", \"Eine kurze Notiz oder Anmerkung\", \"anmerkung schreiben\"],\n notebook: [\"Notizbuch\", \"Notizen, Tagebuch oder Recherche\", \"tagebuch notizen schreiben\"],\n paperclip: [\"Anhang\", \"Eine angehängte Datei\", \"anhängen büroklammer\"],\n pencil: [\"Stift\", \"Schreiben oder Inhalte verfassen\", \"schreiben verfassen\"],\n\n api: [\"API\", \"Eine Programmierschnittstelle\", \"schnittstelle dienst\"],\n \"brand-github\": [\"GitHub\", \"Ein GitHub-Repository oder -Projekt\", \"repository code\"],\n browser: [\"Browser\", \"Eine Website oder ein Webbrowser\", \"web internet webseite\"],\n bug: [\"Fehler\", \"Ein Softwarefehler oder Mangel\", \"käfer problem\"],\n code: [\"Code\", \"Programmierung oder Quellcode\", \"quellcode entwicklung\"],\n database: [\"Datenbank\", \"Strukturierte Datenspeicherung\", \"speicher daten\"],\n \"git-branch\": [\"Git-Branch\", \"Ein Zweig von Quelländerungen\", \"zweig repository\"],\n network: [\"Netzwerk\", \"Verbundene Systeme oder Knoten\", \"verbindung knoten\"],\n robot: [\"Roboter\", \"Automatisierung, ein Bot oder KI\", \"bot ki automatisierung\"],\n server: [\"Server\", \"Ein Host oder Infrastrukturdienst\", \"infrastruktur rechner\"],\n table: [\"Tabelle\", \"Zeilen und Spalten mit Daten\", \"raster spalten zeilen\"],\n terminal: [\"Terminal\", \"Eine Kommandozeile oder Shell\", \"konsole kommandozeile\"],\n wifi: [\"WLAN\", \"Drahtloser Netzwerkzugang\", \"drahtlos internet\"],\n\n at: [\"At-Zeichen\", \"Eine Erwähnung oder E-Mail-Adresse\", \"erwähnung email\"],\n mail: [\"E-Mail\", \"E-Mail oder schriftliche Korrespondenz\", \"nachricht brief post\"],\n \"mail-opened\": [\"Geöffnete E-Mail\", \"Eine gelesene oder geöffnete Nachricht\", \"gelesen nachricht\"],\n message: [\"Nachricht\", \"Chat oder eine Unterhaltung\", \"chat kommentar\"],\n messages: [\"Nachrichten\", \"Eine Unterhaltung mit mehreren Nachrichten\", \"chat unterhaltung\"],\n microphone: [\"Mikrofon\", \"Spracheingabe oder Tonaufnahme\", \"audio stimme aufnahme\"],\n phone: [\"Telefon\", \"Ein Anruf oder eine Telefonnummer\", \"anruf anrufen\"],\n send: [\"Senden\", \"Eine Nachricht oder Einreichung zustellen\", \"abschicken zustellen\"],\n share: [\"Teilen\", \"Inhalte an andere weitergeben\", \"weitergeben sozial\"],\n\n \"building-bank\": [\"Bank\", \"Bankgeschäfte oder ein Finanzinstitut\", \"finanzen geld\"],\n calculator: [\"Taschenrechner\", \"Berechnung oder Buchhaltung\", \"rechnen buchhaltung mathe\"],\n cash: [\"Bargeld\", \"Bargeld oder eine Barzahlung\", \"geld geldschein\"],\n coin: [\"Münze\", \"Geld, Währung oder Guthaben\", \"geld finanzen guthaben\"],\n \"credit-card\": [\"Kreditkarte\", \"Kartenzahlungen und Abrechnung\", \"zahlung geld karte\"],\n \"currency-dollar\": [\"Dollar\", \"Preise oder Beträge in Dollar\", \"währung geld\"],\n \"currency-euro\": [\"Euro\", \"Preise oder Beträge in Euro\", \"währung geld\"],\n percentage: [\"Prozent\", \"Ein Satz, Anteil oder Rabatt\", \"rabatt anteil\"],\n receipt: [\"Beleg\", \"Ein Kauf, eine Rechnung oder Quittung\", \"rechnung quittung kassenbon\"],\n \"shopping-bag\": [\"Einkaufstasche\", \"Einkaufen oder eine Bestellung\", \"einkaufen kaufen bestellung\"],\n \"shopping-cart\": [\"Warenkorb\", \"Artikel zum Kaufen\", \"einkaufen kaufen\"],\n wallet: [\"Geldbörse\", \"Geld, Karten oder ein Kontostand\", \"portemonnaie geld finanzen\"],\n\n bike: [\"Fahrrad\", \"Radfahren oder Fahrradverkehr\", \"rad verkehr\"],\n bus: [\"Bus\", \"Öffentlicher Straßenverkehr\", \"verkehr öffentlich\"],\n car: [\"Auto\", \"Autofahren oder ein Fahrzeug\", \"fahrzeug wagen\"],\n compass: [\"Kompass\", \"Richtung oder Navigation\", \"navigation richtung\"],\n map: [\"Karte\", \"Geografie oder ein Gebietsüberblick\", \"ort geografie landkarte\"],\n \"map-pin\": [\"Standort\", \"Ein bestimmter Ort oder eine Adresse\", \"ort adresse stecknadel\"],\n mountain: [\"Berg\", \"Natur, draußen oder ein Gipfel\", \"natur gipfel draußen\"],\n plane: [\"Flugzeug\", \"Flugreise oder ein Flug\", \"flug reise\"],\n rocket: [\"Rakete\", \"Ein Start, Wachstum oder schneller Beginn\", \"start wachstum weltraum\"],\n route: [\"Route\", \"Ein Weg, eine Reise oder ein Reiseplan\", \"weg reise\"],\n ship: [\"Schiff\", \"Seeverkehr oder Versand\", \"boot see\"],\n tent: [\"Zelt\", \"Camping oder ein Ort im Freien\", \"camping draußen\"],\n train: [\"Zug\", \"Bahnreise oder öffentlicher Verkehr\", \"bahn verkehr\"],\n truck: [\"Lastwagen\", \"Fracht, Logistik oder Lieferung\", \"lkw lieferung versand logistik\"],\n world: [\"Welt\", \"Global, international oder Webinhalte\", \"globus erde web\"],\n\n apple: [\"Apfel\", \"Obst, Essen oder gesunde Ernährung\", \"obst gesund\"],\n cake: [\"Kuchen\", \"Nachtisch oder eine Feier\", \"torte geburtstag feier\"],\n \"chef-hat\": [\"Kochmütze\", \"Kochen, Rezepte oder ein Restaurant\", \"kochen rezept restaurant\"],\n coffee: [\"Kaffee\", \"Kaffee, ein Café oder eine Pause\", \"getränk café pause\"],\n cookie: [\"Keks\", \"Ein Snack, Nachtisch oder Browser-Cookie\", \"plätzchen snack\"],\n glass: [\"Glas\", \"Ein Getränk\", \"getränk wein\"],\n \"ice-cream\": [\"Eis\", \"Ein gefrorener Nachtisch\", \"eiscreme nachtisch\"],\n lemon: [\"Zitrone\", \"Zitrusfrucht oder ein frischer Geschmack\", \"obst zitrus\"],\n mug: [\"Tasse\", \"Ein Heißgetränk oder Becher\", \"becher getränk\"],\n pizza: [\"Pizza\", \"Essen, Lieferung oder ein Restaurant\", \"restaurant lieferung essen\"],\n\n headphones: [\"Kopfhörer\", \"Musik oder Audio hören\", \"audio hören\"],\n music: [\"Musik\", \"Lieder, Klang oder Audio\", \"lied audio\"],\n palette: [\"Palette\", \"Farbe, Kunst oder visuelles Design\", \"farbe kunst design\"],\n photo: [\"Foto\", \"Ein Bild\", \"bild\"],\n \"player-pause\": [\"Pause\", \"Audio- oder Videowiedergabe pausieren\", \"anhalten wiedergabe\"],\n \"player-play\": [\"Abspielen\", \"Audio- oder Videowiedergabe starten\", \"start wiedergabe\"],\n \"player-stop\": [\"Stopp\", \"Audio- oder Videowiedergabe beenden\", \"beenden wiedergabe\"],\n video: [\"Video\", \"Bewegte Bilder oder eine Aufnahme\", \"film kamera\"],\n volume: [\"Lautstärke\", \"Ton oder Audiopegel\", \"ton audio laut\"],\n\n \"device-desktop\": [\"Desktop\", \"Ein Desktop-Computer oder Monitor\", \"computer bildschirm rechner\"],\n \"device-laptop\": [\"Laptop\", \"Ein tragbarer Computer\", \"computer notebook\"],\n \"device-mobile\": [\"Handy\", \"Ein Smartphone oder die mobile Ansicht\", \"telefon smartphone mobil\"],\n \"device-tablet\": [\"Tablet\", \"Ein Tablet oder die Tablet-Ansicht\", \"ipad computer\"],\n plug: [\"Stecker\", \"Strom oder eine Systemverbindung\", \"strom verbinden\"],\n};\n\n/** The default catalogue in a resolved locale; English is the catalogue itself. */\nexport const localizedIconOptions = (locale: string): readonly IconOption[] =>\n locale !== \"de\"\n ? DEFAULT_ICON_OPTIONS\n : DEFAULT_ICON_OPTIONS.map((option) => {\n const text = GERMAN_ICON_TEXTS[option.value.replace(\"ti ti-\", \"\")];\n if (!text) return option;\n const [label, description, keywords] = text;\n return { ...option, label, description, keywords: [...(option.keywords ?? []), String(option.label), ...keywords.split(\" \")] };\n });\n"],"mappings":"AAAA,SAAS,oBAAoB,QAAQ,gBAAgB;AAKrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,iBAAqD,GAAG;EACnE,QAAQ,EAAE,CAAC,WAAW,EAAE,qCAAqC,EAAE,kBAAkB,CAAC;EAClF,WAAW,EAAE,CAAC,QAAQ,EAAE,uCAAuC,EAAE,yBAAyB,CAAC;EAC3F,cAAc,EAAE,CAAC,SAAS,EAAE,oCAAoC,EAAE,gBAAgB,CAAC;EACnF,OAAO,EAAE,CAAC,QAAQ,EAAE,oCAAoC,EAAE,cAAc,CAAC;EACzE,IAAI,EAAE,CAAC,QAAQ,EAAE,qCAAqC,EAAE,6BAA6B,CAAC;EACtF,IAAI,EAAE,CAAC,MAAM,EAAE,oCAAoC,EAAE,yBAAyB,CAAC;EAC/E,QAAQ,EAAE,CAAC,aAAa,EAAE,iCAAiC,EAAE,gBAAgB,CAAC;EAC9E,GAAG,EAAE,CAAC,OAAO,EAAE,kCAAkC,EAAE,oBAAoB,CAAC;EACxE,SAAS,EAAE,CAAC,aAAa,EAAE,4BAA4B,EAAE,yBAAyB,CAAC;EACnF,QAAQ,EAAE,CAAC,SAAS,EAAE,iCAAiC,EAAE,wBAAwB,CAAC;EAClF,QAAQ,EAAE,CAAC,UAAU,EAAE,8BAA8B,EAAE,mBAAmB,CAAC;EAC3E,MAAM,EAAE,CAAC,QAAQ,EAAE,8BAA8B,EAAE,WAAW,CAAC;EAC/D,WAAW,EAAE,CAAC,gBAAgB,EAAE,mCAAmC,EAAE,+BAA+B,CAAC;EACrG,YAAY,EAAE,CAAC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AAE,CAAC,OAAO,EAAE,wCAAwC,EAAE,0BAA0B,CAAC;EAChG,eAAe,EAAE,CAAC,QAAQ,EAAE,oCAAoC,EAAE,eAAe,CAAC;EAClF,IAAI,EAAE,CAAC,SAAS,EAAE,kCAAkC,EAAE,iBAAiB;AACzE,CAAC;;AAED;AACA,OAAO,MAAM,oBAAoB,GAAI,MAAc,IACjD,MAAM,KAAK,IAAI,GACX,oBAAoB,GACpB,oBAAoB,CAAC,GAAG,CAAE,MAAM,IAAK;EACnC,MAAM,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;EAClE,IAAI,CAAC,IAAI,EAAE,OAAO,MAAM;EACxB,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,GAAG,IAAI;EAC3C,OAAO;IAAE,GAAG,MAAM;IAAE,KAAK;IAAE,WAAW;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;EAAE,CAAC;AAChI,CAAC,CAAC","ignoreList":[]}
|
package/dist/ssr/inputs/index.js
CHANGED
|
@@ -11,6 +11,8 @@ export { ColorChoices } from "./ColorChoices";
|
|
|
11
11
|
export { Combobox } from "./Combobox";
|
|
12
12
|
export { abbreviations } from "./completion";
|
|
13
13
|
export { DatePicker, DateRangePicker, DateTimePicker } from "./DatePicker";
|
|
14
|
+
export { createDictation } from "./dictation/create-dictation";
|
|
15
|
+
export { DictationBar, DictationButton, dictationBarShown } from "./dictation/Dictation";
|
|
14
16
|
export { EmojiPicker } from "./emoji/EmojiPicker";
|
|
15
17
|
export { rememberEmoji } from "./emoji/emoji-index";
|
|
16
18
|
export { FileDropTarget, fileDropTarget } from "./FileDropTarget";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type { ChoiceChipOption, ChoiceChipsProps } from \"./ChoiceChips\";\nexport { ChoiceChips } from \"./ChoiceChips\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ChoiceListOption, ChoiceListProps } from \"./ChoiceList\";\nexport { ChoiceList } from \"./ChoiceList\";\nexport type { ChoiceSliderOption, ChoiceSliderProps } from \"./ChoiceSlider\";\nexport { ChoiceSlider } from \"./ChoiceSlider\";\nexport type { ChoiceTileOption, ChoiceTilesProps } from \"./ChoiceTiles\";\nexport { ChoiceTiles } from \"./ChoiceTiles\";\nexport type { ColorChoiceOption, ColorChoicesProps } from \"./ColorChoices\";\nexport { ColorChoices } from \"./ColorChoices\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { EmojiPickerPopoverProps, EmojiPickerProps } from \"./emoji/EmojiPicker\";\nexport { EmojiPicker } from \"./emoji/EmojiPicker\";\nexport type { EmojiSkinTone } from \"./emoji/emoji-index\";\nexport { rememberEmoji } from \"./emoji/emoji-index\";\nexport type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from \"./FileDropTarget\";\nexport { FileDropTarget, fileDropTarget } from \"./FileDropTarget\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { QrScannerError, QrScannerProps } from \"./QrScanner\";\nexport { QrScanner } from \"./QrScanner\";\nexport type {\n RichSelectFact,\n RichSelectFooter,\n RichSelectItem,\n RichSelectProps,\n RichSelectSection,\n RichSelectStatus,\n} from \"./RichSelect\";\nexport { RichSelect, RichSelectFacts } from \"./RichSelect\";\nexport type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { SignatureInputProps } from \"./SignatureInput\";\nexport { SignatureInput } from \"./SignatureInput\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { SignaturePngOptions, SignatureValue } from \"./signature\";\nexport { parseSignature, signatureToPng } from \"./signature\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputProps } from \"./TextInput\";\nexport { TextInput } from \"./TextInput\";\n"],"mappings":"AACA,SAAS,kBAAkB,QAAQ,sBAAsB;AAMzD,SAAS,kBAAkB,QAAQ,sBAAsB;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,WAAW,QAAQ,eAAe;AAM3C,SAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,gBAAgB;AAE7D,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,QAAQ,QAAQ,YAAY;AAQrC,SAAS,aAAa,QAAQ,cAAc;AAU5C,SAAS,UAAU,EAAE,eAAe,EAAE,cAAc,QAAQ,cAAc;AAE1E,SAAS,WAAW,QAAQ,qBAAqB;AAEjD,SAAS,aAAa,QAAQ,qBAAqB;AAEnD,SAAS,cAAc,EAAE,cAAc,QAAQ,kBAAkB;AAEjE,SAAS,YAAY,EAAE,YAAY,EAAE,UAAU,QAAQ,cAAc;AAErE,SAAS,mBAAmB,EAAE,oBAAoB,QAAQ,gBAAgB;AAU1E,SACE,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,QACf,cAAc;AAMrB,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,cAAc,QAAQ,2BAA2B;AAE1D,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,SAAS,QAAQ,aAAa;AASvC,SAAS,UAAU,EAAE,eAAe,QAAQ,cAAc;AAE1D,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,cAAc,QAAQ,kBAAkB;AAEjD,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,cAAc,EAAE,cAAc,QAAQ,aAAa;AAE5D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type { ChoiceChipOption, ChoiceChipsProps } from \"./ChoiceChips\";\nexport { ChoiceChips } from \"./ChoiceChips\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ChoiceListOption, ChoiceListProps } from \"./ChoiceList\";\nexport { ChoiceList } from \"./ChoiceList\";\nexport type { ChoiceSliderOption, ChoiceSliderProps } from \"./ChoiceSlider\";\nexport { ChoiceSlider } from \"./ChoiceSlider\";\nexport type { ChoiceTileOption, ChoiceTilesProps } from \"./ChoiceTiles\";\nexport { ChoiceTiles } from \"./ChoiceTiles\";\nexport type { ColorChoiceOption, ColorChoicesProps } from \"./ColorChoices\";\nexport { ColorChoices } from \"./ColorChoices\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { DictationController, DictationNotice, DictationOptions, DictationStatus } from \"./dictation/create-dictation\";\nexport { createDictation } from \"./dictation/create-dictation\";\nexport type { DictationBarProps, DictationButtonProps } from \"./dictation/Dictation\";\nexport { DictationBar, DictationButton, dictationBarShown } from \"./dictation/Dictation\";\nexport type {\n DictationAlternative,\n DictationDevice,\n DictationEndReason,\n DictationErrorCode,\n DictationEvent,\n DictationSession,\n DictationSource,\n DictationTarget,\n} from \"./dictation/types\";\nexport type { EmojiPickerPopoverProps, EmojiPickerProps } from \"./emoji/EmojiPicker\";\nexport { EmojiPicker } from \"./emoji/EmojiPicker\";\nexport type { EmojiSkinTone } from \"./emoji/emoji-index\";\nexport { rememberEmoji } from \"./emoji/emoji-index\";\nexport type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from \"./FileDropTarget\";\nexport { FileDropTarget, fileDropTarget } from \"./FileDropTarget\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { QrScannerError, QrScannerProps } from \"./QrScanner\";\nexport { QrScanner } from \"./QrScanner\";\nexport type {\n RichSelectFact,\n RichSelectFooter,\n RichSelectItem,\n RichSelectProps,\n RichSelectSection,\n RichSelectStatus,\n} from \"./RichSelect\";\nexport { RichSelect, RichSelectFacts } from \"./RichSelect\";\nexport type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { SignatureInputProps } from \"./SignatureInput\";\nexport { SignatureInput } from \"./SignatureInput\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { SignaturePngOptions, SignatureValue } from \"./signature\";\nexport { parseSignature, signatureToPng } from \"./signature\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputProps } from \"./TextInput\";\nexport { TextInput } from \"./TextInput\";\n"],"mappings":"AACA,SAAS,kBAAkB,QAAQ,sBAAsB;AAMzD,SAAS,kBAAkB,QAAQ,sBAAsB;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,WAAW,QAAQ,eAAe;AAM3C,SAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,gBAAgB;AAE7D,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,QAAQ,QAAQ,YAAY;AAQrC,SAAS,aAAa,QAAQ,cAAc;AAU5C,SAAS,UAAU,EAAE,eAAe,EAAE,cAAc,QAAQ,cAAc;AAE1E,SAAS,eAAe,QAAQ,8BAA8B;AAE9D,SAAS,YAAY,EAAE,eAAe,EAAE,iBAAiB,QAAQ,uBAAuB;AAYxF,SAAS,WAAW,QAAQ,qBAAqB;AAEjD,SAAS,aAAa,QAAQ,qBAAqB;AAEnD,SAAS,cAAc,EAAE,cAAc,QAAQ,kBAAkB;AAEjE,SAAS,YAAY,EAAE,YAAY,EAAE,UAAU,QAAQ,cAAc;AAErE,SAAS,mBAAmB,EAAE,oBAAoB,QAAQ,gBAAgB;AAU1E,SACE,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,QACf,cAAc;AAMrB,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,cAAc,QAAQ,2BAA2B;AAE1D,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,SAAS,QAAQ,aAAa;AASvC,SAAS,UAAU,EAAE,eAAe,QAAQ,cAAc;AAE1D,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,cAAc,QAAQ,kBAAkB;AAEjD,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,cAAc,EAAE,cAAc,QAAQ,aAAa;AAE5D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
|
|
@@ -98,7 +98,7 @@ export function AnchoredPopover(props) {
|
|
|
98
98
|
previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
99
99
|
ring = ringOnReturn(previous ?? anchor);
|
|
100
100
|
}
|
|
101
|
-
setSheet(typeof matchMedia === "function" && matchMedia(sheetQuery).matches);
|
|
101
|
+
setSheet(props.sheet !== false && typeof matchMedia === "function" && matchMedia(sheetQuery).matches);
|
|
102
102
|
setShown(anchor);
|
|
103
103
|
if (!surface.matches(":popover-open")) surface.showPopover();
|
|
104
104
|
place();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["layout/AnchoredPopover.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX, onCleanup, onMount, Show, untrack } from \"solid-js\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\n\nexport type AnchoredPopoverProps = {\n /** The control the panel belongs to. The panel is open while this is set. */\n anchor: HTMLElement | null | undefined;\n /** Called on Escape, a click outside, another press of the anchor, and when the anchor leaves the page. */\n onClose: () => void;\n /** The panel's accessible name; it is a non-modal dialog. */\n label: string;\n children: JSX.Element;\n /** Which edge lines up with the anchor. Defaults to `end`, like a menu at the end of a toolbar. */\n align?: \"start\" | \"end\";\n /** The side tried first; the panel flips only when the other side has more room. Defaults to `below`. */\n side?: \"below\" | \"above\";\n /**\n * The tallest the panel gets while open, in px, such as a list it can switch to. The side is chosen for this height\n * and kept, so a panel that grows never flips. Defaults to its height when it opens.\n */\n plannedHeight?: number;\n /** Width of the panel on wide screens, such as `21rem`. On a phone it is a bottom sheet across the screen. */\n width?: string;\n /** Moves the focus into the panel when it opens; defaults to the panel itself. */\n initialFocus?: () => HTMLElement | null | undefined;\n class?: string;\n};\n\nconst GAP = 6;\nconst MARGIN = 8;\nconst sheetQuery = \"(max-width: 47.999rem)\";\n\n/**\n * A panel anchored to a control, for content that is more than a menu, such as a card with a slider. It opens on the\n * side with room and keeps that side while open, so a panel that changes its content never jumps to the other side.\n * Escape, a click outside and another press of the anchor close it; the focus returns to where it was. On a phone it\n * is a bottom sheet.\n */\nexport function AnchoredPopover(props: AnchoredPopoverProps): JSX.Element {\n let surface: HTMLDivElement | undefined;\n let previous: HTMLElement | null = null;\n let ring = false;\n let pressedAnchor: HTMLElement | undefined;\n /** The side chosen when the panel opened; kept until it closes. */\n let openedAbove: boolean | undefined;\n const [shown, setShown] = createSignal<HTMLElement>();\n const [sheet, setSheet] = createSignal(false);\n\n const place = () => {\n const anchor = shown();\n if (!surface || !anchor) return;\n if (!anchor.isConnected) {\n hide();\n props.onClose();\n return;\n }\n if (sheet()) {\n surface.style.left = \"\";\n surface.style.top = \"\";\n return;\n }\n const viewport = window.visualViewport;\n const view = {\n top: (viewport?.offsetTop ?? 0) + MARGIN,\n bottom: (viewport ? viewport.offsetTop + viewport.height : window.innerHeight) - MARGIN,\n left: (viewport?.offsetLeft ?? 0) + MARGIN,\n right: (viewport ? viewport.offsetLeft + viewport.width : window.innerWidth) - MARGIN,\n };\n const box = anchor.getBoundingClientRect();\n const size = surface.getBoundingClientRect();\n const roomAbove = box.top - GAP - view.top;\n const roomBelow = view.bottom - box.bottom - GAP;\n if (openedAbove === undefined) {\n const planned = Math.max(size.height, props.plannedHeight ?? 0);\n openedAbove =\n (props.side ?? \"below\") === \"above\" ? planned <= roomAbove || roomAbove > roomBelow : planned > roomBelow && roomAbove > roomBelow;\n }\n surface.style.setProperty(\"--k2b-anchored-popover-room\", `${Math.round(Math.max(120, openedAbove ? roomAbove : roomBelow))}px`);\n const top = openedAbove ? box.top - GAP - size.height : box.bottom + GAP;\n const left = (props.align ?? \"end\") === \"end\" ? box.right - size.width : box.left;\n surface.style.left = `${Math.round(Math.max(view.left, Math.min(left, view.right - size.width)))}px`;\n surface.style.top = `${Math.round(Math.max(view.top, Math.min(top, view.bottom - size.height)))}px`;\n };\n\n const restoreFocus = () => {\n const focused = document.activeElement;\n if (focused && focused !== document.body && !surface?.contains(focused)) return;\n if (previous?.isConnected) returnFocus(previous, ring);\n };\n\n const hide = () => {\n restoreFocus();\n if (surface?.matches(\":popover-open\")) surface.hidePopover();\n openedAbove = undefined;\n setShown(undefined);\n };\n\n const pressed = (event: PointerEvent) => {\n const anchor = shown();\n pressedAnchor = anchor && event.target instanceof Node && anchor.contains(event.target) ? anchor : undefined;\n };\n const clicked = (event: MouseEvent) => {\n const anchor = shown();\n if (!anchor || !(event.target instanceof Node) || !anchor.contains(event.target)) return;\n pressedAnchor = anchor;\n hide();\n props.onClose();\n };\n\n createEffect(() => {\n const anchor = props.anchor ?? undefined;\n untrack(() => {\n if (!anchor) {\n if (shown()) hide();\n return;\n }\n if (anchor === pressedAnchor) {\n pressedAnchor = undefined;\n props.onClose();\n return;\n }\n if (shown() === anchor || !surface) return;\n if (!shown()) {\n previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n ring = ringOnReturn(previous ?? anchor);\n }\n setSheet(typeof matchMedia === \"function\" && matchMedia(sheetQuery).matches);\n setShown(anchor);\n if (!surface.matches(\":popover-open\")) surface.showPopover();\n place();\n queueMicrotask(() => (props.initialFocus?.() ?? surface)?.focus({ preventScroll: true }));\n });\n });\n\n const scrolled = (event: Event) => {\n if (!(event.target instanceof Node && surface?.contains(event.target))) place();\n };\n\n onMount(() => {\n window.addEventListener(\"resize\", place);\n window.addEventListener(\"scroll\", scrolled, true);\n window.visualViewport?.addEventListener(\"resize\", place);\n document.addEventListener(\"pointerdown\", pressed, true);\n document.addEventListener(\"click\", clicked, true);\n const observer = typeof ResizeObserver === \"function\" && surface ? new ResizeObserver(place) : undefined;\n if (surface) observer?.observe(surface);\n onCleanup(() => {\n observer?.disconnect();\n window.removeEventListener(\"resize\", place);\n window.removeEventListener(\"scroll\", scrolled, true);\n window.visualViewport?.removeEventListener(\"resize\", place);\n document.removeEventListener(\"pointerdown\", pressed, true);\n document.removeEventListener(\"click\", clicked, true);\n if (surface?.matches(\":popover-open\")) hide();\n });\n });\n\n return (\n <div\n ref={surface}\n popover=\"auto\"\n role=\"dialog\"\n aria-label={props.label}\n tabIndex={-1}\n class={[\"k2b-anchored-popover\", props.class].filter(Boolean).join(\" \")}\n data-sheet={sheet() ? \"\" : undefined}\n style={props.width ? { \"--k2b-anchored-popover-width\": props.width } : undefined}\n onToggle={(event) => {\n if ((event as ToggleEvent).newState === \"open\") return;\n if (shown()) {\n openedAbove = undefined;\n setShown(undefined);\n restoreFocus();\n props.onClose();\n }\n setTimeout(() => {\n pressedAnchor = undefined;\n });\n }}\n >\n <Show when={shown()}>{props.children}</Show>\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAS,YAAY,EAAE,YAAY,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,QAAQ,UAAU;AAClG,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AA0BpE,MAAM,GAAG,GAAG,CAAC;AACb,MAAM,MAAM,GAAG,CAAC;AAChB,MAAM,UAAU,GAAG,wBAAwB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,eAAe,CAAC,KAA2B,EAAe;EACxE,IAAI,OAAmC;EACvC,IAAI,QAA4B,GAAG,IAAI;EACvC,IAAI,IAAI,GAAG,KAAK;EAChB,IAAI,aAAsC;EAC1C;EACA,IAAI,WAAgC;EACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAc,CAAC;EACrD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;EAE7C,MAAM,KAAK,GAAG,MAAM;IAClB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC;IACtB,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE;IACzB,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;MACvB,IAAI,CAAC,CAAC;MACN,KAAK,CAAC,OAAO,CAAC,CAAC;MACf;IACF;IACA,IAAI,KAAK,CAAC,CAAC,EAAE;MACX,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE;MACvB,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE;MACtB;IACF;IACA,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc;IACtC,MAAM,IAAI,GAAG;MACX,GAAG,EAAE,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,IAAI,MAAM;MACxC,MAAM,EAAE,CAAC,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,IAAI,CAAC,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,2DAKgB,KAAK,CAAC,KAAK,kDAEhB,CAAC,sBAAsB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,+CAC1D,KAAK,CAAC,CAAC,GAAG,EAAE,YAAG,SAAS,4BAC7B,KAAK,CAAC,KAAK,GAAG;IAAE,8BAA8B,EAAE,KAAK,CAAC;EAAM,CAAC,GAAG,SAAS,8BAc/E,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,CAAC;IAAA;IAAA;MAAA,OAAG,KAAK,CAAC,QAAQ;IAAA;EAAA;AAG1C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["layout/AnchoredPopover.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX, onCleanup, onMount, Show, untrack } from \"solid-js\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\n\nexport type AnchoredPopoverProps = {\n /** The control the panel belongs to. The panel is open while this is set. */\n anchor: HTMLElement | null | undefined;\n /** Called on Escape, a click outside, another press of the anchor, and when the anchor leaves the page. */\n onClose: () => void;\n /** The panel's accessible name; it is a non-modal dialog. */\n label: string;\n children: JSX.Element;\n /** Which edge lines up with the anchor. Defaults to `end`, like a menu at the end of a toolbar. */\n align?: \"start\" | \"end\";\n /** The side tried first; the panel flips only when the other side has more room. Defaults to `below`. */\n side?: \"below\" | \"above\";\n /**\n * The tallest the panel gets while open, in px, such as a list it can switch to. The side is chosen for this height\n * and kept, so a panel that grows never flips. Defaults to its height when it opens.\n */\n plannedHeight?: number;\n /** Width of the panel on wide screens, such as `21rem`. On a phone it is a bottom sheet across the screen. */\n width?: string;\n /**\n * `false` keeps a small notice beside its control on a phone too, inside the screen with a margin, instead of a\n * bottom sheet that would cover the control. Defaults to `true`.\n */\n sheet?: boolean;\n /** Moves the focus into the panel when it opens; defaults to the panel itself. */\n initialFocus?: () => HTMLElement | null | undefined;\n class?: string;\n};\n\nconst GAP = 6;\nconst MARGIN = 8;\nconst sheetQuery = \"(max-width: 47.999rem)\";\n\n/**\n * A panel anchored to a control, for content that is more than a menu, such as a card with a slider. It opens on the\n * side with room and keeps that side while open, so a panel that changes its content never jumps to the other side.\n * Escape, a click outside and another press of the anchor close it; the focus returns to where it was. On a phone it\n * is a bottom sheet.\n */\nexport function AnchoredPopover(props: AnchoredPopoverProps): JSX.Element {\n let surface: HTMLDivElement | undefined;\n let previous: HTMLElement | null = null;\n let ring = false;\n let pressedAnchor: HTMLElement | undefined;\n /** The side chosen when the panel opened; kept until it closes. */\n let openedAbove: boolean | undefined;\n const [shown, setShown] = createSignal<HTMLElement>();\n const [sheet, setSheet] = createSignal(false);\n\n const place = () => {\n const anchor = shown();\n if (!surface || !anchor) return;\n if (!anchor.isConnected) {\n hide();\n props.onClose();\n return;\n }\n if (sheet()) {\n surface.style.left = \"\";\n surface.style.top = \"\";\n return;\n }\n const viewport = window.visualViewport;\n const view = {\n top: (viewport?.offsetTop ?? 0) + MARGIN,\n bottom: (viewport ? viewport.offsetTop + viewport.height : window.innerHeight) - MARGIN,\n left: (viewport?.offsetLeft ?? 0) + MARGIN,\n right: (viewport ? viewport.offsetLeft + viewport.width : window.innerWidth) - MARGIN,\n };\n const box = anchor.getBoundingClientRect();\n const size = surface.getBoundingClientRect();\n const roomAbove = box.top - GAP - view.top;\n const roomBelow = view.bottom - box.bottom - GAP;\n if (openedAbove === undefined) {\n const planned = Math.max(size.height, props.plannedHeight ?? 0);\n openedAbove =\n (props.side ?? \"below\") === \"above\" ? planned <= roomAbove || roomAbove > roomBelow : planned > roomBelow && roomAbove > roomBelow;\n }\n surface.style.setProperty(\"--k2b-anchored-popover-room\", `${Math.round(Math.max(120, openedAbove ? roomAbove : roomBelow))}px`);\n const top = openedAbove ? box.top - GAP - size.height : box.bottom + GAP;\n const left = (props.align ?? \"end\") === \"end\" ? box.right - size.width : box.left;\n surface.style.left = `${Math.round(Math.max(view.left, Math.min(left, view.right - size.width)))}px`;\n surface.style.top = `${Math.round(Math.max(view.top, Math.min(top, view.bottom - size.height)))}px`;\n };\n\n const restoreFocus = () => {\n const focused = document.activeElement;\n if (focused && focused !== document.body && !surface?.contains(focused)) return;\n if (previous?.isConnected) returnFocus(previous, ring);\n };\n\n const hide = () => {\n restoreFocus();\n if (surface?.matches(\":popover-open\")) surface.hidePopover();\n openedAbove = undefined;\n setShown(undefined);\n };\n\n const pressed = (event: PointerEvent) => {\n const anchor = shown();\n pressedAnchor = anchor && event.target instanceof Node && anchor.contains(event.target) ? anchor : undefined;\n };\n const clicked = (event: MouseEvent) => {\n const anchor = shown();\n if (!anchor || !(event.target instanceof Node) || !anchor.contains(event.target)) return;\n pressedAnchor = anchor;\n hide();\n props.onClose();\n };\n\n createEffect(() => {\n const anchor = props.anchor ?? undefined;\n untrack(() => {\n if (!anchor) {\n if (shown()) hide();\n return;\n }\n if (anchor === pressedAnchor) {\n pressedAnchor = undefined;\n props.onClose();\n return;\n }\n if (shown() === anchor || !surface) return;\n if (!shown()) {\n previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n ring = ringOnReturn(previous ?? anchor);\n }\n setSheet(props.sheet !== false && typeof matchMedia === \"function\" && matchMedia(sheetQuery).matches);\n setShown(anchor);\n if (!surface.matches(\":popover-open\")) surface.showPopover();\n place();\n queueMicrotask(() => (props.initialFocus?.() ?? surface)?.focus({ preventScroll: true }));\n });\n });\n\n const scrolled = (event: Event) => {\n if (!(event.target instanceof Node && surface?.contains(event.target))) place();\n };\n\n onMount(() => {\n window.addEventListener(\"resize\", place);\n window.addEventListener(\"scroll\", scrolled, true);\n window.visualViewport?.addEventListener(\"resize\", place);\n document.addEventListener(\"pointerdown\", pressed, true);\n document.addEventListener(\"click\", clicked, true);\n const observer = typeof ResizeObserver === \"function\" && surface ? new ResizeObserver(place) : undefined;\n if (surface) observer?.observe(surface);\n onCleanup(() => {\n observer?.disconnect();\n window.removeEventListener(\"resize\", place);\n window.removeEventListener(\"scroll\", scrolled, true);\n window.visualViewport?.removeEventListener(\"resize\", place);\n document.removeEventListener(\"pointerdown\", pressed, true);\n document.removeEventListener(\"click\", clicked, true);\n if (surface?.matches(\":popover-open\")) hide();\n });\n });\n\n return (\n <div\n ref={surface}\n popover=\"auto\"\n role=\"dialog\"\n aria-label={props.label}\n tabIndex={-1}\n class={[\"k2b-anchored-popover\", props.class].filter(Boolean).join(\" \")}\n data-sheet={sheet() ? \"\" : undefined}\n style={props.width ? { \"--k2b-anchored-popover-width\": props.width } : undefined}\n onToggle={(event) => {\n if ((event as ToggleEvent).newState === \"open\") return;\n if (shown()) {\n openedAbove = undefined;\n setShown(undefined);\n restoreFocus();\n props.onClose();\n }\n setTimeout(() => {\n pressedAnchor = undefined;\n });\n }}\n >\n <Show when={shown()}>{props.children}</Show>\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAS,YAAY,EAAE,YAAY,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,QAAQ,UAAU;AAClG,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AA+BpE,MAAM,GAAG,GAAG,CAAC;AACb,MAAM,MAAM,GAAG,CAAC;AAChB,MAAM,UAAU,GAAG,wBAAwB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,eAAe,CAAC,KAA2B,EAAe;EACxE,IAAI,OAAmC;EACvC,IAAI,QAA4B,GAAG,IAAI;EACvC,IAAI,IAAI,GAAG,KAAK;EAChB,IAAI,aAAsC;EAC1C;EACA,IAAI,WAAgC;EACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAc,CAAC;EACrD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;EAE7C,MAAM,KAAK,GAAG,MAAM;IAClB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC;IACtB,IA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AE,OAAO,CAAC,OAAO,CAAC;IACvC,SAAS,CAAC,MAAM;MACd,QAAQ,EAAE,UAAU,CAAC,CAAC;MACtB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;MAC3C,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;MACpD,MAAM,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;MAC3D,QAAQ,CAAC,mBAAmB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;MAC1D,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;MACpD,IAAI,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,2DAKgB,KAAK,CAAC,KAAK,kDAEhB,CAAC,sBAAsB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,+CAC1D,KAAK,CAAC,CAAC,GAAG,EAAE,YAAG,SAAS,4BAC7B,KAAK,CAAC,KAAK,GAAG;IAAE,8BAA8B,EAAE,KAAK,CAAC;EAAM,CAAC,GAAG,SAAS,8BAc/E,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,CAAC;IAAA;IAAA;MAAA,OAAG,KAAK,CAAC,QAAQ;IAAA;EAAA;AAG1C","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import { ssr as _$ssr } from "solid-js/web";
|
|
|
3
3
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
4
4
|
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
5
5
|
import { escape as _$escape } from "solid-js/web";
|
|
6
|
-
var _tmpl$ = ["<button", " type=\"button\" role=\"tab\"", ">", "<span class=\"k2b-truncate-fade\">", "</span></button>"],
|
|
6
|
+
var _tmpl$ = ["<button", " type=\"button\" role=\"tab\"", ">", "<span class=\"k2b-truncate-fade-lines\">", "</span></button>"],
|
|
7
7
|
_tmpl$2 = ["<i", " aria-hidden=\"true\"></i>"],
|
|
8
8
|
_tmpl$3 = "<i class=\"ti ti-x\" aria-hidden=\"true\"></i>",
|
|
9
9
|
_tmpl$4 = ["<div class=\"", "\" role=\"region\"", ">", "<aside class=\"k2b-settings__rail\"><nav class=\"k2b-settings__tabs\"", " role=\"tablist\" data-scroll-fade-mode=\"both\" data-scroll-fade-axis=\"horizontal\">", "</nav></aside><div class=\"k2b-settings__content\">", "", "</div></div>"],
|
|
@@ -25,7 +25,7 @@ const isGroupDefinition = value => !!value && typeof value === "object" && value
|
|
|
25
25
|
const isFooterDefinition = value => !!value && typeof value === "object" && value.kind === SETTINGS_MODAL_FOOTER;
|
|
26
26
|
const collectTabs = value => {
|
|
27
27
|
if (Array.isArray(value)) return value.flatMap(collectTabs);
|
|
28
|
-
if (isGroupDefinition(value)) return collectTabs(value.
|
|
28
|
+
if (isGroupDefinition(value)) return collectTabs(value.resolved());
|
|
29
29
|
return isTabDefinition(value) ? [value] : [];
|
|
30
30
|
};
|
|
31
31
|
const collectRailEntries = value => {
|
|
@@ -58,9 +58,13 @@ function SettingsModalTab(props) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
function SettingsModalGroup(props) {
|
|
61
|
+
// The modal's own `children()` does not reach into a group. Resolving here keeps the other tabs of a group the same
|
|
62
|
+
// objects when a conditional tab comes or goes, so the open panel and its unsaved input stay in place.
|
|
63
|
+
const resolved = children(() => props.children);
|
|
61
64
|
return {
|
|
62
65
|
kind: SETTINGS_MODAL_GROUP,
|
|
63
|
-
props
|
|
66
|
+
props,
|
|
67
|
+
resolved
|
|
64
68
|
};
|
|
65
69
|
}
|
|
66
70
|
function SettingsModalFooter(props) {
|
|
@@ -96,7 +100,8 @@ const SettingsModal = props => {
|
|
|
96
100
|
inline: "nearest"
|
|
97
101
|
}));
|
|
98
102
|
});
|
|
99
|
-
|
|
103
|
+
// A memo, so a change elsewhere in the tab list does not create the open panel again.
|
|
104
|
+
const activeTab = createMemo(() => tabs().find(tab => tab.props.id === resolvedActiveTabId()) ?? null);
|
|
100
105
|
const resolvedPanelChildren = children(() => activeTab()?.props.children);
|
|
101
106
|
const panelChildren = createMemo(() => splitPanelChildren(resolvedPanelChildren()));
|
|
102
107
|
const selectTab = id => {
|
|
@@ -155,7 +160,7 @@ const SettingsModal = props => {
|
|
|
155
160
|
},
|
|
156
161
|
children: entry => isGroupDefinition(entry) ? _$ssr(_tmpl$5, _$escape(entry.props.title), _$escape(_$createComponent(For, {
|
|
157
162
|
get each() {
|
|
158
|
-
return collectTabs(entry.
|
|
163
|
+
return collectTabs(entry.resolved());
|
|
159
164
|
},
|
|
160
165
|
children: tab => TabButton(tab)
|
|
161
166
|
}))) : TabButton(entry)
|