@k2b/ui 0.45.0 → 0.47.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/actions/Dropdown.js +8 -1
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +11 -5
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +225 -93
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/chat/ChatDecision.js +10 -6
- package/dist/browser/chat/ChatDecision.js.map +1 -1
- package/dist/browser/content/FileGrid.js +125 -99
- package/dist/browser/content/FileGrid.js.map +1 -1
- package/dist/browser/content/VirtualFeed.js +26 -21
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +14 -6
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/choice.js +36 -9
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/layout/AnchoredPopover.js +2 -1
- package/dist/browser/layout/AnchoredPopover.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +348 -444
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/AppWorkspaceSidebarItemStatus.js +113 -0
- package/dist/browser/layout/AppWorkspaceSidebarItemStatus.js.map +1 -0
- package/dist/browser/layout/DetailPanel.js +130 -108
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/DetailSections.js +1123 -0
- package/dist/browser/layout/DetailSections.js.map +1 -0
- package/dist/browser/layout/DetailsToggle.js +32 -0
- package/dist/browser/layout/DetailsToggle.js.map +1 -0
- package/dist/browser/layout/Discussion.js +3 -0
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/MobileShell.js +141 -102
- package/dist/browser/layout/MobileShell.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +33 -10
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +12 -0
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/detail-sections-messages.js +127 -0
- package/dist/browser/layout/detail-sections-messages.js.map +1 -0
- package/dist/browser/layout/index.js +3 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/surfaces/Avatar.js +3 -1
- package/dist/browser/surfaces/Avatar.js.map +1 -1
- package/dist/browser/surfaces/AvatarStack.js +95 -61
- package/dist/browser/surfaces/AvatarStack.js.map +1 -1
- package/dist/browser/surfaces/ChangeList.js +77 -0
- package/dist/browser/surfaces/ChangeList.js.map +1 -0
- package/dist/browser/surfaces/index.js +2 -1
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/text-editor/TextEditor.js +19 -8
- package/dist/browser/text-editor/TextEditor.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +6 -0
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +1 -1
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +144 -37
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/chat/ChatDecision.js +10 -6
- package/dist/ssr/chat/ChatDecision.js.map +1 -1
- package/dist/ssr/content/FileGrid.js +36 -22
- package/dist/ssr/content/FileGrid.js.map +1 -1
- package/dist/ssr/content/VirtualFeed.js +26 -21
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +6 -3
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/choice.js +36 -9
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/layout/AnchoredPopover.js +2 -1
- package/dist/ssr/layout/AnchoredPopover.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +66 -132
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/AppWorkspaceSidebarItemStatus.js +76 -0
- package/dist/ssr/layout/AppWorkspaceSidebarItemStatus.js.map +1 -0
- package/dist/ssr/layout/DetailPanel.js +18 -1
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/DetailSections.js +838 -0
- package/dist/ssr/layout/DetailSections.js.map +1 -0
- package/dist/ssr/layout/DetailsToggle.js +29 -0
- package/dist/ssr/layout/DetailsToggle.js.map +1 -0
- package/dist/ssr/layout/Discussion.js +3 -0
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/MobileShell.js +60 -29
- package/dist/ssr/layout/MobileShell.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +29 -6
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +12 -0
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/detail-sections-messages.js +127 -0
- package/dist/ssr/layout/detail-sections-messages.js.map +1 -0
- package/dist/ssr/layout/index.js +3 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/surfaces/Avatar.js +3 -1
- package/dist/ssr/surfaces/Avatar.js.map +1 -1
- package/dist/ssr/surfaces/AvatarStack.js +61 -32
- package/dist/ssr/surfaces/AvatarStack.js.map +1 -1
- package/dist/ssr/surfaces/ChangeList.js +37 -0
- package/dist/ssr/surfaces/ChangeList.js.map +1 -0
- package/dist/ssr/surfaces/index.js +2 -1
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/text-editor/TextEditor.js +19 -8
- package/dist/ssr/text-editor/TextEditor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/FilterChip.d.ts +4 -0
- package/dist/types/actions/ViewTabs.d.ts +11 -1
- package/dist/types/chat/ChatDecision.d.ts +5 -0
- package/dist/types/content/FileGrid.d.ts +6 -0
- package/dist/types/inputs/Combobox.d.ts +2 -0
- package/dist/types/inputs/choice.d.ts +9 -3
- package/dist/types/layout/AppWorkspace.d.ts +2 -28
- package/dist/types/layout/AppWorkspaceSidebarItemStatus.d.ts +30 -0
- package/dist/types/layout/DetailPanel.d.ts +9 -0
- package/dist/types/layout/DetailSections.d.ts +186 -0
- package/dist/types/layout/DetailsToggle.d.ts +13 -0
- package/dist/types/layout/MobileShell.d.ts +12 -0
- package/dist/types/layout/PageTitle.d.ts +7 -0
- package/dist/types/layout/detail-sections-messages.d.ts +61 -0
- package/dist/types/layout/index.d.ts +5 -1
- package/dist/types/surfaces/Avatar.d.ts +3 -0
- package/dist/types/surfaces/AvatarStack.d.ts +20 -1
- package/dist/types/surfaces/ChangeList.d.ts +20 -0
- package/dist/types/surfaces/index.d.ts +5 -3
- package/package.json +3 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { template as _$template } from "solid-js/web";
|
|
2
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
3
|
+
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
4
|
+
import { className as _$className } from "solid-js/web";
|
|
5
|
+
import { effect as _$effect } from "solid-js/web";
|
|
6
|
+
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
7
|
+
import { insert as _$insert } from "solid-js/web";
|
|
8
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<ul>`),
|
|
10
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<span class=k2b-change-list__detail>`),
|
|
11
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<li class=k2b-change-list__item><i aria-hidden=true></i><span class=k2b-change-list__text><span></span><!$><!/>`);
|
|
12
|
+
import { For, Show } from "solid-js";
|
|
13
|
+
|
|
14
|
+
/** `add` gains something, `change` alters it, `remove` takes it away, `neutral` names a setting. */
|
|
15
|
+
|
|
16
|
+
const DEFAULT_ICONS = {
|
|
17
|
+
add: "ti ti-plus",
|
|
18
|
+
change: "ti ti-arrows-exchange",
|
|
19
|
+
remove: "ti ti-minus",
|
|
20
|
+
neutral: "ti ti-point",
|
|
21
|
+
warning: "ti ti-alert-triangle"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Pending changes before they are saved, one line each, so a person can check them in one look. */
|
|
25
|
+
export function ChangeList(props) {
|
|
26
|
+
return (() => {
|
|
27
|
+
var _el$ = _$getNextElement(_tmpl$);
|
|
28
|
+
_$insert(_el$, _$createComponent(For, {
|
|
29
|
+
get each() {
|
|
30
|
+
return props.items;
|
|
31
|
+
},
|
|
32
|
+
children: item => (() => {
|
|
33
|
+
var _el$2 = _$getNextElement(_tmpl$3),
|
|
34
|
+
_el$3 = _el$2.firstChild,
|
|
35
|
+
_el$4 = _el$3.nextSibling,
|
|
36
|
+
_el$5 = _el$4.firstChild,
|
|
37
|
+
_el$7 = _el$5.nextSibling,
|
|
38
|
+
[_el$8, _co$] = _$getNextMarker(_el$7.nextSibling);
|
|
39
|
+
_$insert(_el$5, () => item.content);
|
|
40
|
+
_$insert(_el$4, _$createComponent(Show, {
|
|
41
|
+
get when() {
|
|
42
|
+
return item.detail;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
var _el$6 = _$getNextElement(_tmpl$2);
|
|
46
|
+
_$insert(_el$6, () => item.detail);
|
|
47
|
+
return _el$6;
|
|
48
|
+
}
|
|
49
|
+
}), _el$8, _co$);
|
|
50
|
+
_$effect(_p$ => {
|
|
51
|
+
var _v$3 = item.tone,
|
|
52
|
+
_v$4 = `${item.icon ?? DEFAULT_ICONS[item.tone]} k2b-change-list__icon`;
|
|
53
|
+
_v$3 !== _p$.e && _$setAttribute(_el$2, "data-tone", _p$.e = _v$3);
|
|
54
|
+
_v$4 !== _p$.t && _$className(_el$3, _p$.t = _v$4);
|
|
55
|
+
return _p$;
|
|
56
|
+
}, {
|
|
57
|
+
e: undefined,
|
|
58
|
+
t: undefined
|
|
59
|
+
});
|
|
60
|
+
return _el$2;
|
|
61
|
+
})()
|
|
62
|
+
}));
|
|
63
|
+
_$effect(_p$ => {
|
|
64
|
+
var _v$ = `k2b-change-list ${props.class ?? ""}`,
|
|
65
|
+
_v$2 = props.label;
|
|
66
|
+
_v$ !== _p$.e && _$className(_el$, _p$.e = _v$);
|
|
67
|
+
_v$2 !== _p$.t && _$setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
68
|
+
return _p$;
|
|
69
|
+
}, {
|
|
70
|
+
e: undefined,
|
|
71
|
+
t: undefined
|
|
72
|
+
});
|
|
73
|
+
return _el$;
|
|
74
|
+
})();
|
|
75
|
+
}
|
|
76
|
+
export default ChangeList;
|
|
77
|
+
//# sourceMappingURL=ChangeList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/ChangeList.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\n\n/** `add` gains something, `change` alters it, `remove` takes it away, `neutral` names a setting. */\nexport type ChangeTone = \"add\" | \"change\" | \"remove\" | \"neutral\" | \"warning\";\n\nexport type ChangeListItem = {\n tone: ChangeTone;\n /** A Tabler icon class; defaults to plus, arrows or minus by tone. */\n icon?: string;\n content: JSX.Element;\n /** One quiet line under the content, such as what the change means for others. */\n detail?: JSX.Element;\n};\n\nexport type ChangeListProps = {\n items: readonly ChangeListItem[];\n /** Names the list for assistive technology, such as \"What changes\". */\n label: string;\n class?: string;\n};\n\nconst DEFAULT_ICONS: Record<ChangeTone, string> = {\n add: \"ti ti-plus\",\n change: \"ti ti-arrows-exchange\",\n remove: \"ti ti-minus\",\n neutral: \"ti ti-point\",\n warning: \"ti ti-alert-triangle\",\n};\n\n/** Pending changes before they are saved, one line each, so a person can check them in one look. */\nexport function ChangeList(props: ChangeListProps): JSX.Element {\n return (\n <ul class={`k2b-change-list ${props.class ?? \"\"}`} aria-label={props.label}>\n <For each={props.items}>\n {(item) => (\n <li class=\"k2b-change-list__item\" data-tone={item.tone}>\n <i class={`${item.icon ?? DEFAULT_ICONS[item.tone]} k2b-change-list__icon`} aria-hidden=\"true\" />\n <span class=\"k2b-change-list__text\">\n <span>{item.content}</span>\n <Show when={item.detail}>\n <span class=\"k2b-change-list__detail\">{item.detail}</span>\n </Show>\n </span>\n </li>\n )}\n </For>\n </ul>\n );\n}\n\nexport default ChangeList;\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,GAAG,EAAY,IAAI,QAAQ,UAAU;;AAE9C;;AAmBA,MAAM,aAAyC,GAAG;EAChD,GAAG,EAAE,YAAY;EACjB,MAAM,EAAE,uBAAuB;EAC/B,MAAM,EAAE,aAAa;EACrB,OAAO,EAAE,aAAa;EACtB,OAAO,EAAE;AACX,CAAC;;AAED;AACA,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAe;EAC9D;IAAA;IAAA,iCAEK,GAAG;MAAA,IAAC,IAAI;QAAA,OAAE,KAAK,CAAC,KAAK;MAAA;MAAA,UAClB,IAAI;QAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA,sBAIO,IAAI,CAAC,OAAO;QAAA,kCAClB,IAAI;UAAA,IAAC,IAAI;YAAA,OAAE,IAAI,CAAC,MAAM;UAAA;UAAA;YAAA;YAAA,sBACkB,IAAI,CAAC,MAAM;YAAA;UAAA;QAAA;QAAA;UAAA,WALX,IAAI,CAAC,IAAI;YAAA,OAC1C,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB;UAAA;UAAA;UAAA;QAAA;UAAA;UAAA;QAAA;QAAA;MAAA;IAQ7E;IAAA;MAAA,UAZM,mBAAmB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;QAAA,OAAc,KAAK,CAAC,KAAK;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA;AAgB9E;AAEA,eAAe,UAAU","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Avatar } from "./Avatar";
|
|
2
|
-
export { AvatarStack } from "./AvatarStack";
|
|
2
|
+
export { AvatarFaces, AvatarStack } from "./AvatarStack";
|
|
3
|
+
export { ChangeList } from "./ChangeList";
|
|
3
4
|
export { DescriptionList } from "./DescriptionList";
|
|
4
5
|
export { DotStrip } from "./DotStrip";
|
|
5
6
|
export { LinkCard } from "./LinkCard";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/index.ts"],"sourcesContent":["export type { AvatarProps, AvatarRing, AvatarShape, AvatarSize } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarStack } from \"./AvatarStack\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarProps, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport { Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellProps, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,QAAQ,eAAe;
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/index.ts"],"sourcesContent":["export type { AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarTone } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarFacesPerson, AvatarFacesProps, AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarFaces, AvatarStack } from \"./AvatarStack\";\nexport type { ChangeListItem, ChangeListProps, ChangeTone } from \"./ChangeList\";\nexport { ChangeList } from \"./ChangeList\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarProps, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport { Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellProps, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,EAAE,WAAW,QAAQ,eAAe;AAExD,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,mBAAmB,EAAE,UAAU,QAAQ,cAAc;AAE9D,SAAS,KAAK,QAAQ,SAAS;AAQ/B,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAEtD,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,aAAa,EAAE,WAAW,QAAQ,gBAAgB;AAE3D,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,QAAQ,QAA4B,YAAY;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAQrC,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,GAAG,QAAQ,OAAO","ignoreList":[]}
|
|
@@ -506,11 +506,20 @@ export function TextEditor(props) {
|
|
|
506
506
|
positionMenu();
|
|
507
507
|
});
|
|
508
508
|
};
|
|
509
|
-
const unavailable = () => !!props.host?.structure && !props.host.structure.available();
|
|
509
|
+
const unavailable = createMemo(() => !!props.host?.structure && !props.host.structure.available());
|
|
510
|
+
// Closed table menus keep their entries until they open again. A host may report another availability on every
|
|
511
|
+
// edit, and each entry rebuilt or re-enabled in a hidden menu restyles the whole page through the shared `:has()`
|
|
512
|
+
// rules, so typing would lag.
|
|
513
|
+
const [tableMenuShown, setTableMenuShown] = createSignal(false);
|
|
514
|
+
const whileMenuShown = read => createMemo(last => tableMenuShown() ? read() : last, untrack(read));
|
|
515
|
+
const menuRevision = whileMenuShown(documentRevision);
|
|
516
|
+
const menuUnavailable = whileMenuShown(unavailable);
|
|
510
517
|
const actionDisabled = action => {
|
|
511
|
-
|
|
518
|
+
menuRevision();
|
|
519
|
+
menuUnavailable();
|
|
512
520
|
const wrap = cell()?.closest(".k2b-ste-table");
|
|
513
|
-
|
|
521
|
+
const view = editor?.view;
|
|
522
|
+
return blocked() || !view || !wrap || untrack(() => !tableActionEnabled(view, wrap, action));
|
|
514
523
|
};
|
|
515
524
|
const isMove = action => action.startsWith("move");
|
|
516
525
|
const runAction = action => {
|
|
@@ -551,11 +560,11 @@ export function TextEditor(props) {
|
|
|
551
560
|
deleteCol: "menuDelete"
|
|
552
561
|
};
|
|
553
562
|
const menuRow = () => {
|
|
554
|
-
|
|
563
|
+
menuRevision();
|
|
555
564
|
return t().menuRow(Number(cell()?.dataset.r ?? 0));
|
|
556
565
|
};
|
|
557
566
|
const menuColumn = () => {
|
|
558
|
-
|
|
567
|
+
menuRevision();
|
|
559
568
|
const column = Number(cell()?.dataset.c ?? 0);
|
|
560
569
|
const header = cell()?.closest(".k2b-ste-table")?.querySelector(`.k2b-ste-cell[data-r="0"][data-c="${column}"]`);
|
|
561
570
|
return t().menuColumn(header?.dataset.raw || t().column(column + 1));
|
|
@@ -639,7 +648,7 @@ export function TextEditor(props) {
|
|
|
639
648
|
const items = kind => {
|
|
640
649
|
if (props.readOnly) return copyItems();
|
|
641
650
|
const align = () => {
|
|
642
|
-
|
|
651
|
+
menuRevision();
|
|
643
652
|
return cell()?.parentElement?.style.textAlign || "left";
|
|
644
653
|
};
|
|
645
654
|
const row = [{
|
|
@@ -676,7 +685,7 @@ export function TextEditor(props) {
|
|
|
676
685
|
choice: "checkbox",
|
|
677
686
|
class: "k2b-ste-header-choice",
|
|
678
687
|
checked: () => {
|
|
679
|
-
|
|
688
|
+
menuRevision();
|
|
680
689
|
return cell()?.closest(".k2b-ste-table")?.dataset.header === "true";
|
|
681
690
|
}
|
|
682
691
|
}), {
|
|
@@ -686,7 +695,7 @@ export function TextEditor(props) {
|
|
|
686
695
|
const wrap = cell()?.closest(".k2b-ste-table");
|
|
687
696
|
if (editor && wrap) editTableSource(editor.view, wrap);
|
|
688
697
|
}
|
|
689
|
-
}, ...copyItems(), actionItem("deleteTable"), ...(
|
|
698
|
+
}, ...copyItems(), actionItem("deleteTable"), ...(menuUnavailable() ? [{
|
|
690
699
|
label: t().structureUnavailable,
|
|
691
700
|
disabled: true
|
|
692
701
|
}] : [])]
|
|
@@ -702,6 +711,7 @@ export function TextEditor(props) {
|
|
|
702
711
|
const tableMenuChange = open => {
|
|
703
712
|
menuOpen = open;
|
|
704
713
|
tableMenuOpen = open && !phoneMenu();
|
|
714
|
+
setTableMenuShown(open);
|
|
705
715
|
};
|
|
706
716
|
let swallow;
|
|
707
717
|
const pressBesideMenu = event => {
|
|
@@ -742,6 +752,7 @@ export function TextEditor(props) {
|
|
|
742
752
|
const menuClose = () => {
|
|
743
753
|
menuOpen = false;
|
|
744
754
|
tableMenuOpen = false;
|
|
755
|
+
setTableMenuShown(false);
|
|
745
756
|
setScope("cell");
|
|
746
757
|
grip = undefined;
|
|
747
758
|
schedulePosition();
|