@k2b/ui 0.55.0 → 0.57.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.
Files changed (126) hide show
  1. package/dist/browser/actions/SplitButton.js +5 -7
  2. package/dist/browser/actions/SplitButton.js.map +1 -1
  3. package/dist/browser/actions/Toolbar.js +16 -7
  4. package/dist/browser/actions/Toolbar.js.map +1 -1
  5. package/dist/browser/actions/ViewTabs.js +6 -5
  6. package/dist/browser/actions/ViewTabs.js.map +1 -1
  7. package/dist/browser/chat/ChatComposer.js +28 -27
  8. package/dist/browser/chat/ChatComposer.js.map +1 -1
  9. package/dist/browser/content/Lightbox.js +917 -283
  10. package/dist/browser/content/Lightbox.js.map +1 -1
  11. package/dist/browser/content/PdfPages.js +8 -3
  12. package/dist/browser/content/PdfPages.js.map +1 -1
  13. package/dist/browser/content/PdfThumbnails.js +271 -0
  14. package/dist/browser/content/PdfThumbnails.js.map +1 -0
  15. package/dist/browser/content/PdfViewer.js +11 -3
  16. package/dist/browser/content/PdfViewer.js.map +1 -1
  17. package/dist/browser/content/Timeline.js +116 -117
  18. package/dist/browser/content/Timeline.js.map +1 -1
  19. package/dist/browser/content/code-highlight.js +24 -11
  20. package/dist/browser/content/code-highlight.js.map +1 -1
  21. package/dist/browser/content/index.js +5 -1
  22. package/dist/browser/content/index.js.map +1 -1
  23. package/dist/browser/content/lightbox-messages.js +64 -18
  24. package/dist/browser/content/lightbox-messages.js.map +1 -1
  25. package/dist/browser/content/lightbox-renderers.js +6 -0
  26. package/dist/browser/content/lightbox-renderers.js.map +1 -0
  27. package/dist/browser/content/map-view-worker.js +3 -3
  28. package/dist/browser/content/pdf-messages.js +16 -2
  29. package/dist/browser/content/pdf-messages.js.map +1 -1
  30. package/dist/browser/content/pdf-viewer-engine.js +15 -15
  31. package/dist/browser/content/pdf-viewer-worker.js +4 -5
  32. package/dist/browser/feedback/prompt-confirm.js +2 -0
  33. package/dist/browser/feedback/prompt-confirm.js.map +1 -1
  34. package/dist/browser/internal/truncated-title.js +9 -0
  35. package/dist/browser/internal/truncated-title.js.map +1 -0
  36. package/dist/browser/intl/messages.js +1 -1
  37. package/dist/browser/intl/messages.js.map +1 -1
  38. package/dist/browser/layout/DetailPanel.js +3 -5
  39. package/dist/browser/layout/DetailPanel.js.map +1 -1
  40. package/dist/browser/layout/FloatingWindow.js +416 -122
  41. package/dist/browser/layout/FloatingWindow.js.map +1 -1
  42. package/dist/browser/layout/PanelDialog.js +3 -1
  43. package/dist/browser/layout/PanelDialog.js.map +1 -1
  44. package/dist/browser/layout/PersonPopover.js +406 -0
  45. package/dist/browser/layout/PersonPopover.js.map +1 -0
  46. package/dist/browser/layout/floating-window-geometry.js +58 -2
  47. package/dist/browser/layout/floating-window-geometry.js.map +1 -1
  48. package/dist/browser/layout/floating-window-messages.js +12 -0
  49. package/dist/browser/layout/floating-window-messages.js.map +1 -1
  50. package/dist/browser/layout/index.js +1 -0
  51. package/dist/browser/layout/index.js.map +1 -1
  52. package/dist/ssr/actions/CommandMenu.js +2 -2
  53. package/dist/ssr/actions/CommandMenu.js.map +1 -1
  54. package/dist/ssr/actions/SplitButton.js +5 -7
  55. package/dist/ssr/actions/SplitButton.js.map +1 -1
  56. package/dist/ssr/actions/Toolbar.js +16 -7
  57. package/dist/ssr/actions/Toolbar.js.map +1 -1
  58. package/dist/ssr/actions/ViewTabs.js +6 -5
  59. package/dist/ssr/actions/ViewTabs.js.map +1 -1
  60. package/dist/ssr/chat/ChatComposer.js +31 -30
  61. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  62. package/dist/ssr/content/Lightbox.js +659 -150
  63. package/dist/ssr/content/Lightbox.js.map +1 -1
  64. package/dist/ssr/content/PdfPages.js +8 -3
  65. package/dist/ssr/content/PdfPages.js.map +1 -1
  66. package/dist/ssr/content/PdfThumbnails.js +189 -0
  67. package/dist/ssr/content/PdfThumbnails.js.map +1 -0
  68. package/dist/ssr/content/PdfViewer.js +11 -3
  69. package/dist/ssr/content/PdfViewer.js.map +1 -1
  70. package/dist/ssr/content/Timeline.js +2 -5
  71. package/dist/ssr/content/Timeline.js.map +1 -1
  72. package/dist/ssr/content/code-highlight.js +24 -11
  73. package/dist/ssr/content/code-highlight.js.map +1 -1
  74. package/dist/ssr/content/index.js +5 -1
  75. package/dist/ssr/content/index.js.map +1 -1
  76. package/dist/ssr/content/lightbox-messages.js +64 -18
  77. package/dist/ssr/content/lightbox-messages.js.map +1 -1
  78. package/dist/ssr/content/lightbox-renderers.js +6 -0
  79. package/dist/ssr/content/lightbox-renderers.js.map +1 -0
  80. package/dist/ssr/content/pdf-messages.js +16 -2
  81. package/dist/ssr/content/pdf-messages.js.map +1 -1
  82. package/dist/ssr/feedback/prompt-confirm.js +1 -0
  83. package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
  84. package/dist/ssr/inputs/ChoiceInputs.js +2 -2
  85. package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
  86. package/dist/ssr/inputs/SignatureInput.js +2 -2
  87. package/dist/ssr/inputs/SignatureInput.js.map +1 -1
  88. package/dist/ssr/inputs/markdown/SlashCommands.js +2 -2
  89. package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -1
  90. package/dist/ssr/internal/truncated-title.js +9 -0
  91. package/dist/ssr/internal/truncated-title.js.map +1 -0
  92. package/dist/ssr/intl/messages.js +1 -1
  93. package/dist/ssr/intl/messages.js.map +1 -1
  94. package/dist/ssr/layout/DetailPanel.js +1 -4
  95. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  96. package/dist/ssr/layout/FloatingWindow.js +286 -73
  97. package/dist/ssr/layout/FloatingWindow.js.map +1 -1
  98. package/dist/ssr/layout/PanelDialog.js +1 -0
  99. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  100. package/dist/ssr/layout/PersonPopover.js +248 -0
  101. package/dist/ssr/layout/PersonPopover.js.map +1 -0
  102. package/dist/ssr/layout/floating-window-geometry.js +58 -2
  103. package/dist/ssr/layout/floating-window-geometry.js.map +1 -1
  104. package/dist/ssr/layout/floating-window-messages.js +12 -0
  105. package/dist/ssr/layout/floating-window-messages.js.map +1 -1
  106. package/dist/ssr/layout/index.js +1 -0
  107. package/dist/ssr/layout/index.js.map +1 -1
  108. package/dist/styles.css +1 -1
  109. package/dist/types/actions/SplitButton.d.ts +2 -0
  110. package/dist/types/actions/Toolbar.d.ts +6 -0
  111. package/dist/types/chat/ChatComposer.d.ts +1 -0
  112. package/dist/types/content/Lightbox.d.ts +54 -14
  113. package/dist/types/content/PdfPages.d.ts +7 -1
  114. package/dist/types/content/PdfThumbnails.d.ts +26 -0
  115. package/dist/types/content/PdfViewer.d.ts +12 -3
  116. package/dist/types/content/index.d.ts +4 -2
  117. package/dist/types/content/lightbox-messages.d.ts +31 -8
  118. package/dist/types/content/lightbox-renderers.d.ts +3 -0
  119. package/dist/types/content/pdf-messages.d.ts +7 -0
  120. package/dist/types/internal/truncated-title.d.ts +7 -0
  121. package/dist/types/layout/FloatingWindow.d.ts +29 -1
  122. package/dist/types/layout/PersonPopover.d.ts +70 -0
  123. package/dist/types/layout/floating-window-geometry.d.ts +20 -3
  124. package/dist/types/layout/floating-window-messages.d.ts +6 -0
  125. package/dist/types/layout/index.d.ts +3 -2
  126. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["layout/DetailPanel.tsx"],"sourcesContent":["import { createUniqueId, type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, IconButton } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { SectionFrameDefault } from \"../surfaces/Section\";\nimport { useDetailPanelMessages } from \"./detail-panel-messages\";\nimport { createScrollFade } from \"./scroll-fade\";\n\nexport type DetailPanelProps = {\n /** Plain sections share their host surface, as in AppWorkspace.Detail. */\n surface?: \"default\" | \"plain\";\n children: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelHeaderBaseProps = {\n /**\n * The item's state, such as a \"Done\" or \"Read only\" badge, at the start of the line below the title. Name a type\n * only where one list mixes types that the title and subtitle do not tell apart, such as \"Query\" or \"Action\".\n */\n kind?: JSX.Element;\n title: JSX.Element;\n subtitle?: JSX.Element;\n meta?: JSX.Element;\n /**\n * The resource's \"…\" menu, shown before `actions`. Pass every less frequent command on the shown resource here,\n * so each panel opens its menu from the same place; an empty list shows no button.\n */\n menu?: readonly DropdownItem[];\n /** Accessible name of the \"…\" button. Defaults to \"More actions\". */\n menuLabel?: string;\n actions?: JSX.Element;\n primaryActions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelHeaderProps = DetailPanelHeaderBaseProps &\n (\n | {\n leading?: JSX.Element;\n icon?: never;\n }\n | {\n leading?: never;\n icon?: string;\n }\n );\n\nexport type DetailPanelBodyProps = {\n scrollFade?: boolean;\n children: JSX.Element;\n scrollPreserveKey?: string;\n class?: string;\n};\n\nexport type DetailPanelSummaryProps = {\n title: JSX.Element;\n children: JSX.Element;\n actions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelGroupProps = {\n children: JSX.Element;\n label?: string;\n /**\n * A visible quiet title, such as \"More about this conversation\". Its sections then stand flush as rows below\n * it, which suits collapsed secondary sections with a `summary`.\n */\n title?: JSX.Element;\n class?: string;\n};\n\n/** One direct secondary command, rendered as a sibling icon button at the end of the row. */\nexport type DetailPanelActionSecondary = {\n /** Icon class, for example `ti ti-trash`. */\n icon: string;\n /** Accessible name and tooltip of the icon button. */\n label: string;\n onClick: () => void;\n variant?: \"danger\";\n};\n\n/**\n * A checkbox before the row that toggles on its own, such as \"done\" for a task the row opens. It always shows its\n * state, unlike a secondary action, which waits for hover.\n */\nexport type DetailPanelActionCheckbox = {\n checked: boolean;\n /** Accessible name, after the row, such as \"Done: Call Mrs. Weber\". */\n label: string;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n};\n\ntype DetailPanelActionBaseProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n secondaryAction?: DetailPanelActionSecondary;\n checkbox?: DetailPanelActionCheckbox;\n /** Marks the row of the current place, such as the section in view, in the panel's accent. */\n current?: boolean;\n /** Lets the title wrap to two lines instead of ending with an ellipsis. */\n wrap?: boolean;\n class?: string;\n};\n\ntype DetailPanelActionMenuProps =\n | {\n menuItems?: never;\n menuLabel?: never;\n }\n | {\n menuItems: readonly DropdownItem[];\n menuLabel: string;\n };\n\nexport type DetailPanelActionLinkProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonLinkProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href: string;\n };\n\nexport type DetailPanelActionButtonProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href?: never;\n };\n\nexport type DetailPanelActionProps = DetailPanelActionLinkProps | DetailPanelActionButtonProps;\n\n/** A row that only shows something, such as a person and their role: the columns of an action, without a command. */\nexport type DetailPanelRowProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {\n Header: (props: DetailPanelHeaderProps) => JSX.Element;\n Body: (props: DetailPanelBodyProps) => JSX.Element;\n Summary: (props: DetailPanelSummaryProps) => JSX.Element;\n Group: (props: DetailPanelGroupProps) => JSX.Element;\n Action: (props: DetailPanelActionProps) => JSX.Element;\n Row: (props: DetailPanelRowProps) => JSX.Element;\n};\n\nconst classNames = (base: string, extra?: string): string => (extra ? `${base} ${extra}` : base);\n\nconst showTruncatedTitle = (event: PointerEvent & { currentTarget: HTMLHeadingElement }) => {\n const heading = event.currentTarget;\n if (heading.scrollHeight > heading.clientHeight + 1) heading.title = heading.textContent ?? \"\";\n else heading.removeAttribute(\"title\");\n};\n\nconst DetailPanelHeader = (props: DetailPanelHeaderProps): JSX.Element => {\n const t = useDetailPanelMessages();\n const menuLabel = () => props.menuLabel ?? t().moreActions;\n const menuTrigger = () => (\n <Dropdown.Root items={props.menu ?? []} align=\"end\" label={menuLabel()} phone=\"sheet\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={menuLabel()} tooltip={menuLabel()}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n // With primary actions, \"…\" ends their row, next to the commands it extends; otherwise it sits beside close.\n const menuInActions = () => Boolean(props.menu?.length) && !props.primaryActions;\n return (\n <header class={classNames(\"k2b-detail-panel__header\", props.class)}>\n <div class=\"k2b-detail-panel__header-main\" data-identity={props.icon || props.leading ? \"true\" : undefined}>\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__header-icon\" aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <Show when={props.leading}>\n <div class=\"k2b-detail-panel__header-leading\">{props.leading}</div>\n </Show>\n <div class=\"k2b-detail-panel__heading\">\n {/* The name comes first, beside the close button. A long title wraps to two lines and ends with an ellipsis;\n then the native hint shows all of it. */}\n <h2 onPointerEnter={showTruncatedTitle}>{props.title}</h2>\n <Show when={props.kind || props.subtitle || props.meta}>\n <div class=\"k2b-detail-panel__supporting\">\n <Show when={props.kind}>\n <div class=\"k2b-detail-panel__kind\">{props.kind}</div>\n </Show>\n <Show when={props.subtitle}>\n <p>{props.subtitle}</p>\n </Show>\n <Show when={props.meta}>\n <div class=\"k2b-detail-panel__meta\">{props.meta}</div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={menuInActions() || props.actions}>\n <div class=\"k2b-detail-panel__actions\">\n <Show when={menuInActions()}>{menuTrigger()}</Show>\n {props.actions}\n </div>\n </Show>\n </div>\n <Show when={props.primaryActions}>\n <div class=\"k2b-detail-panel__primary-actions\">\n {props.primaryActions}\n <Show when={props.menu?.length}>{menuTrigger()}</Show>\n </div>\n </Show>\n </header>\n );\n};\n\nconst DetailPanelBody = (props: DetailPanelBodyProps): JSX.Element => {\n let body!: HTMLDivElement;\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <div\n ref={body}\n class={classNames(\"k2b-detail-panel__body\", props.class)}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n data-scroll-preserve={props.scrollPreserveKey}\n >\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSummary = (props: DetailPanelSummaryProps): JSX.Element => {\n const headingId = `k2b-detail-panel-summary-${createUniqueId()}`;\n\n return (\n <section class={classNames(\"k2b-detail-panel__summary\", props.class)} aria-labelledby={headingId}>\n <header class=\"k2b-detail-panel__summary-header\">\n <h3 id={headingId}>{props.title}</h3>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__summary-actions\">{props.actions}</div>\n </Show>\n </header>\n <div class=\"k2b-detail-panel__summary-body\">{props.children}</div>\n </section>\n );\n};\n\nconst DetailPanelGroup = (props: DetailPanelGroupProps): JSX.Element => {\n const titleId = `k2b-detail-panel-group-${createUniqueId()}`;\n return (\n <div\n class={classNames(\"k2b-detail-panel__group\", props.class)}\n role=\"group\"\n aria-label={props.title ? undefined : props.label}\n aria-labelledby={props.title ? titleId : undefined}\n data-titled={props.title ? \"true\" : undefined}\n >\n <Show when={props.title}>\n <div class=\"k2b-detail-panel__group-title\" id={titleId}>\n {props.title}\n </div>\n </Show>\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelActionContent = (props: DetailPanelActionBaseProps): JSX.Element => (\n <>\n {/* Hidden while empty: a row's icon, or its text when it has none, starts on the section's text edge. */}\n <span class=\"k2b-detail-panel__action-leading\">{props.leading}</span>\n <span class=\"k2b-detail-panel__action-copy\">\n <span class=\"k2b-detail-panel__action-title\">{props.title}</span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__action-description\">{props.description}</span>\n </Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-detail-panel__action-trailing\">{props.trailing}</span>\n </Show>\n </>\n);\n\nconst DetailPanelAction = (props: DetailPanelActionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"class\",\n \"current\",\n \"description\",\n \"href\",\n \"leading\",\n \"menuItems\",\n \"menuLabel\",\n \"secondaryAction\",\n \"checkbox\",\n \"title\",\n \"trailing\",\n \"wrap\",\n ]);\n const className = classNames(\"k2b-detail-panel__action\", local.class);\n const content = () => (\n <DetailPanelActionContent title={local.title} description={local.description} leading={local.leading} trailing={local.trailing} />\n );\n\n const action = () => (\n <Show\n when={local.href !== undefined}\n fallback={\n <Button\n {...(rest as Omit<DetailPanelActionButtonProps, keyof DetailPanelActionBaseProps>)}\n class={className}\n aria-current={local.current ? \"true\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </Button>\n }\n >\n <ButtonLink\n {...(rest as Omit<DetailPanelActionLinkProps, keyof DetailPanelActionBaseProps | \"href\">)}\n href={local.href as string}\n class={className}\n aria-current={local.current ? \"location\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </ButtonLink>\n </Show>\n );\n\n return (\n <Show when={local.secondaryAction || local.menuItems?.length || local.checkbox} fallback={action()}>\n <div class=\"k2b-detail-panel__action-row\" data-checkbox={local.checkbox ? \"true\" : undefined}>\n <Show when={local.checkbox}>\n {(checkbox) => (\n <Checkbox\n class=\"k2b-detail-panel__action-check\"\n aria-label={checkbox().label}\n value={checkbox().checked}\n disabled={checkbox().disabled}\n onValueChange={(checked) => checkbox().onChange(checked)}\n />\n )}\n </Show>\n {action()}\n <Show when={local.secondaryAction}>\n {(secondary) => (\n <IconButton\n size=\"sm\"\n variant=\"ghost\"\n label={secondary().label}\n class=\"k2b-detail-panel__action-secondary\"\n data-tone={secondary().variant}\n onClick={() => secondary().onClick()}\n >\n <i class={secondary().icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </Show>\n <Show when={local.menuItems?.length}>\n <Dropdown.Root items={local.menuItems ?? []} align=\"end\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu-trigger\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </div>\n </Show>\n );\n};\n\nconst DetailPanelRow = (props: DetailPanelRowProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel__row\", props.class)}>\n <DetailPanelActionContent title={props.title} description={props.description} leading={props.leading} trailing={props.trailing} />\n </div>\n);\n\n/**\n * The panel for one selected object. Its topics are `Section`s; the panel frames them itself, so they stand flat\n * inside it.\n */\nconst DetailPanel = ((props: DetailPanelProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel\", props.class)} data-surface={props.surface}>\n <SectionFrameDefault.Provider value=\"none\">{props.children}</SectionFrameDefault.Provider>\n </div>\n)) as DetailPanelComponent;\n\nDetailPanel.Header = DetailPanelHeader;\nDetailPanel.Body = DetailPanelBody;\nDetailPanel.Summary = DetailPanelSummary;\nDetailPanel.Group = DetailPanelGroup;\nDetailPanel.Action = DetailPanelAction;\nDetailPanel.Row = DetailPanelRow;\n\nexport default DetailPanel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AACrE,SAAS,MAAM,EAAE,UAAU,EAA0C,UAAU,QAAQ,mBAAmB;AAC1G,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAAS,QAAQ,QAAQ,oBAAoB;AAC7C,SAAS,mBAAmB,QAAQ,qBAAqB;AACzD,SAAS,sBAAsB,QAAQ,yBAAyB;AAChE,SAAS,gBAAgB,QAAQ,eAAe;;AAmEhD;;AAUA;AACA;AACA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AC/B,UAAU,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,0DAAgB,KAAK,CAAC,OAAO,4CACjF,mBAAmB,CAAC,QAAQ;EAAC,KAAK;EAAA;IAAA,OAAS,KAAK,CAAC,QAAQ;EAAA;AAAA,IAEpC;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,KAAK,GAAG,gBAAgB;AACpC,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,GAAG,GAAG,cAAc;AAEhC,eAAe,WAAW","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/DetailPanel.tsx"],"sourcesContent":["import { createUniqueId, type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, IconButton } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { showTruncatedTitle } from \"../internal/truncated-title\";\nimport { SectionFrameDefault } from \"../surfaces/Section\";\nimport { useDetailPanelMessages } from \"./detail-panel-messages\";\nimport { createScrollFade } from \"./scroll-fade\";\n\nexport type DetailPanelProps = {\n /** Plain sections share their host surface, as in AppWorkspace.Detail. */\n surface?: \"default\" | \"plain\";\n children: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelHeaderBaseProps = {\n /**\n * The item's state, such as a \"Done\" or \"Read only\" badge, at the start of the line below the title. Name a type\n * only where one list mixes types that the title and subtitle do not tell apart, such as \"Query\" or \"Action\".\n */\n kind?: JSX.Element;\n title: JSX.Element;\n subtitle?: JSX.Element;\n meta?: JSX.Element;\n /**\n * The resource's \"…\" menu, shown before `actions`. Pass every less frequent command on the shown resource here,\n * so each panel opens its menu from the same place; an empty list shows no button.\n */\n menu?: readonly DropdownItem[];\n /** Accessible name of the \"…\" button. Defaults to \"More actions\". */\n menuLabel?: string;\n actions?: JSX.Element;\n primaryActions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelHeaderProps = DetailPanelHeaderBaseProps &\n (\n | {\n leading?: JSX.Element;\n icon?: never;\n }\n | {\n leading?: never;\n icon?: string;\n }\n );\n\nexport type DetailPanelBodyProps = {\n scrollFade?: boolean;\n children: JSX.Element;\n scrollPreserveKey?: string;\n class?: string;\n};\n\nexport type DetailPanelSummaryProps = {\n title: JSX.Element;\n children: JSX.Element;\n actions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelGroupProps = {\n children: JSX.Element;\n label?: string;\n /**\n * A visible quiet title, such as \"More about this conversation\". Its sections then stand flush as rows below\n * it, which suits collapsed secondary sections with a `summary`.\n */\n title?: JSX.Element;\n class?: string;\n};\n\n/** One direct secondary command, rendered as a sibling icon button at the end of the row. */\nexport type DetailPanelActionSecondary = {\n /** Icon class, for example `ti ti-trash`. */\n icon: string;\n /** Accessible name and tooltip of the icon button. */\n label: string;\n onClick: () => void;\n variant?: \"danger\";\n};\n\n/**\n * A checkbox before the row that toggles on its own, such as \"done\" for a task the row opens. It always shows its\n * state, unlike a secondary action, which waits for hover.\n */\nexport type DetailPanelActionCheckbox = {\n checked: boolean;\n /** Accessible name, after the row, such as \"Done: Call Mrs. Weber\". */\n label: string;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n};\n\ntype DetailPanelActionBaseProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n secondaryAction?: DetailPanelActionSecondary;\n checkbox?: DetailPanelActionCheckbox;\n /** Marks the row of the current place, such as the section in view, in the panel's accent. */\n current?: boolean;\n /** Lets the title wrap to two lines instead of ending with an ellipsis. */\n wrap?: boolean;\n class?: string;\n};\n\ntype DetailPanelActionMenuProps =\n | {\n menuItems?: never;\n menuLabel?: never;\n }\n | {\n menuItems: readonly DropdownItem[];\n menuLabel: string;\n };\n\nexport type DetailPanelActionLinkProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonLinkProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href: string;\n };\n\nexport type DetailPanelActionButtonProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href?: never;\n };\n\nexport type DetailPanelActionProps = DetailPanelActionLinkProps | DetailPanelActionButtonProps;\n\n/** A row that only shows something, such as a person and their role: the columns of an action, without a command. */\nexport type DetailPanelRowProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {\n Header: (props: DetailPanelHeaderProps) => JSX.Element;\n Body: (props: DetailPanelBodyProps) => JSX.Element;\n Summary: (props: DetailPanelSummaryProps) => JSX.Element;\n Group: (props: DetailPanelGroupProps) => JSX.Element;\n Action: (props: DetailPanelActionProps) => JSX.Element;\n Row: (props: DetailPanelRowProps) => JSX.Element;\n};\n\nconst classNames = (base: string, extra?: string): string => (extra ? `${base} ${extra}` : base);\n\nconst DetailPanelHeader = (props: DetailPanelHeaderProps): JSX.Element => {\n const t = useDetailPanelMessages();\n const menuLabel = () => props.menuLabel ?? t().moreActions;\n const menuTrigger = () => (\n <Dropdown.Root items={props.menu ?? []} align=\"end\" label={menuLabel()} phone=\"sheet\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={menuLabel()} tooltip={menuLabel()}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n // With primary actions, \"…\" ends their row, next to the commands it extends; otherwise it sits beside close.\n const menuInActions = () => Boolean(props.menu?.length) && !props.primaryActions;\n return (\n <header class={classNames(\"k2b-detail-panel__header\", props.class)}>\n <div class=\"k2b-detail-panel__header-main\" data-identity={props.icon || props.leading ? \"true\" : undefined}>\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__header-icon\" aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <Show when={props.leading}>\n <div class=\"k2b-detail-panel__header-leading\">{props.leading}</div>\n </Show>\n <div class=\"k2b-detail-panel__heading\">\n {/* The name comes first, beside the close button. It never wraps: a long title ends with an ellipsis, and\n then the native hint shows all of it. */}\n <h2 onPointerEnter={showTruncatedTitle}>{props.title}</h2>\n <Show when={props.kind || props.subtitle || props.meta}>\n <div class=\"k2b-detail-panel__supporting\">\n <Show when={props.kind}>\n <div class=\"k2b-detail-panel__kind\">{props.kind}</div>\n </Show>\n <Show when={props.subtitle}>\n <p>{props.subtitle}</p>\n </Show>\n <Show when={props.meta}>\n <div class=\"k2b-detail-panel__meta\">{props.meta}</div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={menuInActions() || props.actions}>\n <div class=\"k2b-detail-panel__actions\">\n <Show when={menuInActions()}>{menuTrigger()}</Show>\n {props.actions}\n </div>\n </Show>\n </div>\n <Show when={props.primaryActions}>\n <div class=\"k2b-detail-panel__primary-actions\">\n {props.primaryActions}\n <Show when={props.menu?.length}>{menuTrigger()}</Show>\n </div>\n </Show>\n </header>\n );\n};\n\nconst DetailPanelBody = (props: DetailPanelBodyProps): JSX.Element => {\n let body!: HTMLDivElement;\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <div\n ref={body}\n class={classNames(\"k2b-detail-panel__body\", props.class)}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n data-scroll-preserve={props.scrollPreserveKey}\n >\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSummary = (props: DetailPanelSummaryProps): JSX.Element => {\n const headingId = `k2b-detail-panel-summary-${createUniqueId()}`;\n\n return (\n <section class={classNames(\"k2b-detail-panel__summary\", props.class)} aria-labelledby={headingId}>\n <header class=\"k2b-detail-panel__summary-header\">\n <h3 id={headingId}>{props.title}</h3>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__summary-actions\">{props.actions}</div>\n </Show>\n </header>\n <div class=\"k2b-detail-panel__summary-body\">{props.children}</div>\n </section>\n );\n};\n\nconst DetailPanelGroup = (props: DetailPanelGroupProps): JSX.Element => {\n const titleId = `k2b-detail-panel-group-${createUniqueId()}`;\n return (\n <div\n class={classNames(\"k2b-detail-panel__group\", props.class)}\n role=\"group\"\n aria-label={props.title ? undefined : props.label}\n aria-labelledby={props.title ? titleId : undefined}\n data-titled={props.title ? \"true\" : undefined}\n >\n <Show when={props.title}>\n <div class=\"k2b-detail-panel__group-title\" id={titleId}>\n {props.title}\n </div>\n </Show>\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelActionContent = (props: DetailPanelActionBaseProps): JSX.Element => (\n <>\n {/* Hidden while empty: a row's icon, or its text when it has none, starts on the section's text edge. */}\n <span class=\"k2b-detail-panel__action-leading\">{props.leading}</span>\n <span class=\"k2b-detail-panel__action-copy\">\n <span class=\"k2b-detail-panel__action-title\">{props.title}</span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__action-description\">{props.description}</span>\n </Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-detail-panel__action-trailing\">{props.trailing}</span>\n </Show>\n </>\n);\n\nconst DetailPanelAction = (props: DetailPanelActionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"class\",\n \"current\",\n \"description\",\n \"href\",\n \"leading\",\n \"menuItems\",\n \"menuLabel\",\n \"secondaryAction\",\n \"checkbox\",\n \"title\",\n \"trailing\",\n \"wrap\",\n ]);\n const className = classNames(\"k2b-detail-panel__action\", local.class);\n const content = () => (\n <DetailPanelActionContent title={local.title} description={local.description} leading={local.leading} trailing={local.trailing} />\n );\n\n const action = () => (\n <Show\n when={local.href !== undefined}\n fallback={\n <Button\n {...(rest as Omit<DetailPanelActionButtonProps, keyof DetailPanelActionBaseProps>)}\n class={className}\n aria-current={local.current ? \"true\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </Button>\n }\n >\n <ButtonLink\n {...(rest as Omit<DetailPanelActionLinkProps, keyof DetailPanelActionBaseProps | \"href\">)}\n href={local.href as string}\n class={className}\n aria-current={local.current ? \"location\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </ButtonLink>\n </Show>\n );\n\n return (\n <Show when={local.secondaryAction || local.menuItems?.length || local.checkbox} fallback={action()}>\n <div class=\"k2b-detail-panel__action-row\" data-checkbox={local.checkbox ? \"true\" : undefined}>\n <Show when={local.checkbox}>\n {(checkbox) => (\n <Checkbox\n class=\"k2b-detail-panel__action-check\"\n aria-label={checkbox().label}\n value={checkbox().checked}\n disabled={checkbox().disabled}\n onValueChange={(checked) => checkbox().onChange(checked)}\n />\n )}\n </Show>\n {action()}\n <Show when={local.secondaryAction}>\n {(secondary) => (\n <IconButton\n size=\"sm\"\n variant=\"ghost\"\n label={secondary().label}\n class=\"k2b-detail-panel__action-secondary\"\n data-tone={secondary().variant}\n onClick={() => secondary().onClick()}\n >\n <i class={secondary().icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </Show>\n <Show when={local.menuItems?.length}>\n <Dropdown.Root items={local.menuItems ?? []} align=\"end\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu-trigger\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </div>\n </Show>\n );\n};\n\nconst DetailPanelRow = (props: DetailPanelRowProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel__row\", props.class)}>\n <DetailPanelActionContent title={props.title} description={props.description} leading={props.leading} trailing={props.trailing} />\n </div>\n);\n\n/**\n * The panel for one selected object. Its topics are `Section`s; the panel frames them itself, so they stand flat\n * inside it.\n */\nconst DetailPanel = ((props: DetailPanelProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel\", props.class)} data-surface={props.surface}>\n <SectionFrameDefault.Provider value=\"none\">{props.children}</SectionFrameDefault.Provider>\n </div>\n)) as DetailPanelComponent;\n\nDetailPanel.Header = DetailPanelHeader;\nDetailPanel.Body = DetailPanelBody;\nDetailPanel.Summary = DetailPanelSummary;\nDetailPanel.Group = DetailPanelGroup;\nDetailPanel.Action = DetailPanelAction;\nDetailPanel.Row = DetailPanelRow;\n\nexport default DetailPanel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AACrE,SAAS,MAAM,EAAE,UAAU,EAA0C,UAAU,QAAQ,mBAAmB;AAC1G,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAAS,QAAQ,QAAQ,oBAAoB;AAC7C,SAAS,kBAAkB,QAAQ,6BAA6B;AAChE,SAAS,mBAAmB,QAAQ,qBAAqB;AACzD,SAAS,sBAAsB,QAAQ,yBAAyB;AAChE,SAAS,gBAAgB,QAAQ,eAAe;;AAmEhD;;AAUA;AACA;AACA;AACA;;AA+CA;;AAkBA,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAc,KAAc,KAAK,GAAG,GAAG,IAAI,IAAI,KAAK,EAAE,GAAG,IAAK;AAEhG,MAAM,iBAAiB,GAAI,KAA6B,IAAkB;EACxE,MAAM,CAAC,GAAG,sBAAsB,CAAC,CAAC;EAClC,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW;EAC1D,MAAM,WAAW,GAAG,wBACjB,QAAQ,CAAC,IAAI;IAAA,IAAC,KAAK;MAAA,OAAE,KAAK,CAAC,IAAI,IAAI,EAAE;IAAA;IAAE,KAAK;IAAA,IAAO,KAA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AS,KAAK;kBAAA,OAAE,KAAK,CAAC,SAAS;gBAAA;gBAAA;gBAAA;kBAAA;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAQvF,CAAC;AAED,MAAM,cAAc,GAAI,KAA0B,oDACpC,UAAU,CAAC,uBAAuB,EAAE,KAAK,CAAC,KAAK,CAAC,4CACzD,wBAAwB;EAAA,IAAC,KAAK;IAAA,OAAE,KAAK,CAAC,KAAK;EAAA;EAAA,IAAE,WAAW;IAAA,OAAE,KAAK,CAAC,WAAW;EAAA;EAAA,IAAE,OAAO;IAAA,OAAE,KAAK,CAAC,OAAO;EAAA;EAAA,IAAE,QAAQ;IAAA,OAAE,KAAK,CAAC,QAAQ;EAAA;AAAA,IAEjI;;AAED;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAK,KAAuB,oDAC/B,UAAU,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,0DAAgB,KAAK,CAAC,OAAO,4CACjF,mBAAmB,CAAC,QAAQ;EAAC,KAAK;EAAA;IAAA,OAAS,KAAK,CAAC,QAAQ;EAAA;AAAA,IAEpC;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,KAAK,GAAG,gBAAgB;AACpC,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,GAAG,GAAG,cAAc;AAEhC,eAAe,WAAW","ignoreList":[]}
@@ -1,24 +1,33 @@
1
1
  import { mergeProps as _$mergeProps } from "solid-js/web";
2
- import { memo as _$memo } from "solid-js/web";
3
- import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
4
- import { ssr as _$ssr } from "solid-js/web";
5
- import { createComponent as _$createComponent } from "solid-js/web";
6
- import { ssrStyle as _$ssrStyle } from "solid-js/web";
7
2
  import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
3
+ import { createComponent as _$createComponent } from "solid-js/web";
4
+ import { ssr as _$ssr } from "solid-js/web";
8
5
  import { escape as _$escape } from "solid-js/web";
9
- var _tmpl$ = ["<section class=\"", "\"", " style=\"", "\" role=\"dialog\" aria-modal=\"false\"", " tabindex=\"-1\"><header>", "<button type=\"button\" data-window-move class=\"k2b-floating-window__title\"", "><span", ">", "</span></button><button type=\"button\" class=\"k2b-icon-button\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button></header><div class=\"k2b-floating-window__body\">", "</div>", "</section>"],
10
- _tmpl$2 = ["<i", " aria-hidden=\"true\"></i>"],
11
- _tmpl$3 = ["<button type=\"button\" class=\"k2b-floating-window__resize\"", " style=\"", "\"", "></button>"],
12
- _tmpl$4 = ["<div class=\"k2b-floating-window__resize\"", " style=\"", "\" aria-hidden=\"true\"></div>"];
13
- import { createSignal, createUniqueId, onCleanup, onMount, Show } from "solid-js";
6
+ import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
7
+ import { memo as _$memo } from "solid-js/web";
8
+ var _tmpl$ = ["<div class=\"k2b-floating-window-scrim\" aria-hidden=\"true\" style=\"", "\"></div>"],
9
+ _tmpl$2 = ["<span class=\"k2b-floating-window__status\">", "</span>"],
10
+ _tmpl$3 = ["<div class=\"k2b-floating-window__actions\">", "</div>"],
11
+ _tmpl$4 = "<i class=\"ti ti-minus\" aria-hidden=\"true\"></i>",
12
+ _tmpl$5 = ["<i", " aria-hidden=\"true\"></i>"],
13
+ _tmpl$6 = "<i class=\"ti ti-x\" aria-hidden=\"true\"></i>",
14
+ _tmpl$7 = ["<section class=\"", "\"", " style=\"", "\" role=\"dialog\"", " tabindex=\"-1\"><header>", "<div class=\"k2b-floating-window__heading\"><button type=\"button\" data-window-move class=\"k2b-floating-window__title\"", "><span", ">", "</span></button>", "</div>", "<div class=\"k2b-floating-window__controls\">", "", "</div></header><div class=\"k2b-floating-window__body\">", "</div>", "</section>"],
15
+ _tmpl$8 = ["<button type=\"button\" class=\"k2b-floating-window__resize\"", " style=\"", "\"", "></button>"],
16
+ _tmpl$9 = ["<div class=\"k2b-floating-window__resize\"", " style=\"", "\" aria-hidden=\"true\"></div>"];
17
+ import { createEffect, createMemo, createSignal, createUniqueId, on, onCleanup, onMount, Show, untrack } from "solid-js";
14
18
  import { Portal, render } from "solid-js/web";
19
+ import { IconButton } from "../actions/Button";
15
20
  import { returnFocus, ringOnReturn } from "../internal/focus-return";
16
21
  import { getK2bPortalRoot } from "../internal/portal";
17
22
  import { RenderErrorBoundary } from "../internal/render-error";
18
23
  import { suppressTextSelection } from "../internal/text-selection";
19
- import { FLOATING_WINDOW_VIEWPORT_GAP, fitFloatingWindowRect } from "./floating-window-geometry";
24
+ import { showTruncatedTitle } from "../internal/truncated-title";
25
+ import { FLOATING_WINDOW_BAR, FLOATING_WINDOW_VIEWPORT_GAP, fitFloatingWindowRect, layoutFloatingWindowDock, maximizedFloatingWindowRect } from "./floating-window-geometry";
20
26
  import { useFloatingWindowMessages } from "./floating-window-messages";
21
27
  export { fitFloatingWindowRect } from "./floating-window-geometry";
28
+
29
+ /** `minimized` is a bar at the bottom edge with the content kept alive; `maximized` covers the area above a scrim. */
30
+
22
31
  const MOBILE_BREAKPOINT = 640;
23
32
  const FLOATING_WINDOW_LAYER_BASE = 80;
24
33
  const activeLayers = [];
@@ -42,8 +51,13 @@ const bringLayerToFront = owner => {
42
51
  activeLayers.push(owner);
43
52
  syncLayers();
44
53
  };
45
- const isTopLayer = owner => activeLayers.at(-1) === owner;
54
+
55
+ /** Every docked window of the page, in the order the windows opened, so a row never reorders when one restores. */
56
+
57
+ const [dockMembers, setDockMembers] = createSignal([]);
46
58
  const clamp = (value, min, max) => Math.min(Math.max(value, min), Math.max(min, max));
59
+ const sameRect = (a, b) => a === b || !!a && !!b && a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
60
+ const tabbable = 'a[href],button:not(:disabled),input:not(:disabled):not([type="hidden"]),select:not(:disabled),textarea:not(:disabled),[contenteditable="true"],[tabindex]:not([tabindex="-1"])';
47
61
  export default function FloatingWindow(props) {
48
62
  const floatingWindowMessages = useFloatingWindowMessages();
49
63
  const minWidth = () => props.minWidth ?? 360;
@@ -53,25 +67,105 @@ export default function FloatingWindow(props) {
53
67
  const layerOwner = {
54
68
  setLayer
55
69
  };
56
- const [rect, setRect] = createSignal({
57
- x: FLOATING_WINDOW_VIEWPORT_GAP,
58
- y: FLOATING_WINDOW_VIEWPORT_GAP,
59
- width: props.initialWidth ?? 720,
60
- height: props.initialHeight ?? 640
70
+ const [ownState, setOwnState] = createSignal(untrack(() => props.defaultState ?? "normal"));
71
+ const state = () => props.state ?? ownState();
72
+ const [areaElement, setAreaElement] = createSignal();
73
+ const [bounds, setBounds] = createSignal({
74
+ x: 0,
75
+ y: 0,
76
+ width: typeof window === "undefined" ? 1024 : window.innerWidth,
77
+ height: typeof window === "undefined" ? 768 : window.innerHeight,
78
+ radius: "0px"
61
79
  });
80
+ /** The place the person or the application gave the window; unset while it places itself. */
81
+ const [placed, setPlaced] = createSignal();
62
82
  const titleId = `k2b-floating-window-${createUniqueId()}`;
63
83
  let frame;
84
+ let titleButton;
85
+ let maximizeButton;
86
+ let body;
87
+ /** The last focused element of the content, where the focus returns when the window comes back from the bar. */
88
+ let contentFocus;
64
89
  let stopPointerInteraction;
65
- const fit = value => fitFloatingWindowRect(value, minWidth(), minHeight(), {
66
- width: window.innerWidth,
67
- height: window.innerHeight
90
+ const fit = value => fitFloatingWindowRect(value, minWidth(), minHeight(), bounds());
91
+ const ownSize = () => {
92
+ const area = bounds();
93
+ return fit({
94
+ x: area.x,
95
+ y: area.y,
96
+ width: props.initialWidth ?? 720,
97
+ height: props.initialHeight ?? 640
98
+ });
99
+ };
100
+ const docked = () => state() === "minimized" || state() === "normal" && !placed() && !mobile() && props.placement === "dock";
101
+ const dockMember = {
102
+ area: areaElement,
103
+ docked,
104
+ size: () => state() === "minimized" ? FLOATING_WINDOW_BAR : ownSize()
105
+ };
106
+ const dockRect = createMemo(() => {
107
+ if (!docked()) return undefined;
108
+ const row = dockMembers().filter(member => member.area() === areaElement() && member.docked());
109
+ return layoutFloatingWindowDock(row.map(member => member.size()), bounds())[row.indexOf(dockMember)];
68
110
  });
111
+ /** The window's box, or nothing while it is a full-screen sheet on a phone. */
112
+ const frameRect = createMemo(() => {
113
+ if (mobile() && state() !== "minimized") return undefined;
114
+ if (state() === "maximized") return maximizedFloatingWindowRect(bounds());
115
+ const dock = dockRect();
116
+ if (dock) return dock;
117
+ const own = placed();
118
+ if (own) return own;
119
+ const size = ownSize();
120
+ const area = bounds();
121
+ return fit({
122
+ ...size,
123
+ x: area.x + (area.width - size.width) / 2,
124
+ y: area.y + (area.height - size.height) / 2
125
+ });
126
+ }, undefined, {
127
+ equals: sameRect
128
+ });
129
+ const modal = () => state() === "maximized" || mobile() && state() === "normal";
69
130
  const front = () => bringLayerToFront(layerOwner);
70
131
  const stopActivePointerInteraction = () => stopPointerInteraction?.();
71
132
  const close = () => {
72
133
  stopActivePointerInteraction();
73
134
  props.onClose();
74
135
  };
136
+ const commitRect = next => {
137
+ setPlaced(next);
138
+ props.onRectChange?.(next);
139
+ };
140
+ const focusInside = () => {
141
+ const active = document.activeElement;
142
+ return active instanceof HTMLElement && frame?.contains(active) ? active : undefined;
143
+ };
144
+ const changeState = next => {
145
+ const previous = state();
146
+ if (next === previous) return;
147
+ stopActivePointerInteraction();
148
+ const hadFocus = focusInside();
149
+ setOwnState(next);
150
+ props.onStateChange?.(next);
151
+ front();
152
+ // The focus follows the window: onto the bar when it minimizes, back to where it was when the content returns.
153
+ queueMicrotask(() => {
154
+ if (state() !== next) return;
155
+ if (next === "minimized") {
156
+ if (hadFocus || document.activeElement === document.body) titleButton?.focus({
157
+ preventScroll: true
158
+ });
159
+ return;
160
+ }
161
+ const current = focusInside();
162
+ if (current && current !== titleButton) return;
163
+ const target = contentFocus?.isConnected && body?.contains(contentFocus) ? contentFocus : frame;
164
+ target?.focus({
165
+ preventScroll: true
166
+ });
167
+ });
168
+ };
75
169
  const trackPointerInteraction = (start, move) => {
76
170
  stopActivePointerInteraction();
77
171
  const pointerId = start.pointerId;
@@ -90,56 +184,118 @@ export default function FloatingWindow(props) {
90
184
  if (event.pointerId === pointerId) move(event);
91
185
  };
92
186
  const onEnd = event => {
93
- if (event.pointerId === pointerId) stop();
187
+ if (event.pointerId !== pointerId) return;
188
+ stop();
189
+ const current = placed();
190
+ if (current) props.onRectChange?.(current);
94
191
  };
95
192
  stopPointerInteraction = stop;
96
193
  window.addEventListener("pointermove", onMove);
97
194
  window.addEventListener("pointerup", onEnd);
98
195
  window.addEventListener("pointercancel", onEnd);
99
196
  };
197
+ createEffect(on(() => props.rect, rect => {
198
+ if (rect) setPlaced(fit(rect));
199
+ }));
100
200
  onMount(() => {
101
201
  registerLayer(layerOwner);
102
- const viewport = () => {
103
- const compact = window.innerWidth < MOBILE_BREAKPOINT;
104
- setMobile(compact);
105
- if (!compact) setRect(current => fit(current));
202
+ setDockMembers(members => [...members, dockMember]);
203
+ let observer;
204
+ const measure = () => {
205
+ const area = props.area?.() ?? undefined;
206
+ if (area !== areaElement()) {
207
+ observer?.disconnect();
208
+ if (area) observer?.observe(area);
209
+ setAreaElement(area);
210
+ }
211
+ const box = area?.getBoundingClientRect();
212
+ const next = box ? {
213
+ x: box.left,
214
+ y: box.top,
215
+ width: box.width,
216
+ height: box.height,
217
+ radius: getComputedStyle(area).borderRadius
218
+ } : {
219
+ x: 0,
220
+ y: 0,
221
+ width: window.innerWidth,
222
+ height: window.innerHeight,
223
+ radius: "0px"
224
+ };
225
+ const current = bounds();
226
+ if (next.x !== current.x || next.y !== current.y || next.width !== current.width || next.height !== current.height) setBounds(next);
227
+ setMobile(window.innerWidth < MOBILE_BREAKPOINT);
228
+ setPlaced(rect => rect ? fit(rect) : rect);
106
229
  };
107
- setRect(current => fit({
108
- ...current,
109
- x: (window.innerWidth - current.width) / 2,
110
- y: (window.innerHeight - current.height) / 2
111
- }));
112
- viewport();
230
+ observer = typeof ResizeObserver === "function" ? new ResizeObserver(measure) : undefined;
231
+ measure();
232
+ if (!placed() && props.placement !== "dock") {
233
+ const size = ownSize();
234
+ const area = bounds();
235
+ setPlaced(fit({
236
+ ...size,
237
+ x: area.x + (area.width - size.width) / 2,
238
+ y: area.y + (area.height - size.height) / 2
239
+ }));
240
+ }
113
241
  const escape = event => {
114
- if (event.defaultPrevented || event.key !== "Escape" || !isTopLayer(layerOwner)) return;
242
+ if (event.defaultPrevented || event.key !== "Escape" || state() === "minimized") return;
243
+ if (!(event.target instanceof Node && frame?.contains(event.target))) return;
115
244
  event.preventDefault();
116
- close();
245
+ if (state() === "maximized" && !mobile()) changeState("normal");else close();
117
246
  };
118
- window.addEventListener("resize", viewport);
247
+ window.addEventListener("resize", measure);
119
248
  window.addEventListener("keydown", escape);
120
- const focus = requestAnimationFrame(() => frame?.focus());
249
+ // The content may already have placed the focus, such as an editor that opened with the window.
250
+ const focus = requestAnimationFrame(() => {
251
+ if (state() !== "minimized" && !focusInside()) frame?.focus();
252
+ });
121
253
  onCleanup(() => {
122
254
  stopActivePointerInteraction();
255
+ observer?.disconnect();
123
256
  releaseLayer(layerOwner);
257
+ setDockMembers(members => members.filter(member => member !== dockMember));
124
258
  cancelAnimationFrame(focus);
125
- window.removeEventListener("resize", viewport);
259
+ window.removeEventListener("resize", measure);
126
260
  window.removeEventListener("keydown", escape);
127
261
  });
128
262
  });
129
- const moveBy = (deltaX, deltaY) => setRect(current => fit({
130
- ...current,
131
- x: current.x + deltaX,
132
- y: current.y + deltaY
133
- }));
263
+
264
+ /** While the window covers the area, Tab cycles inside it. */
265
+ const trapTab = event => {
266
+ if (event.key !== "Tab" || !modal() || !frame) return;
267
+ const stops = [...frame.querySelectorAll(tabbable)].filter(element => element.getClientRects().length > 0);
268
+ const first = stops[0];
269
+ const last = stops.at(-1);
270
+ if (!first || !last) return;
271
+ const active = document.activeElement;
272
+ if (event.shiftKey && (active === first || active === frame)) {
273
+ last.focus();
274
+ event.preventDefault();
275
+ } else if (!event.shiftKey && active === last) {
276
+ first.focus();
277
+ event.preventDefault();
278
+ }
279
+ };
280
+ const moveBy = (deltaX, deltaY) => {
281
+ const current = frameRect();
282
+ if (current) commitRect(fit({
283
+ ...current,
284
+ x: current.x + deltaX,
285
+ y: current.y + deltaY
286
+ }));
287
+ };
288
+ const movable = () => !mobile() && state() === "normal";
134
289
  const beginMove = event => {
135
- if (mobile() || event.button !== 0 || event.target.closest("button:not([data-window-move])")) return;
136
- const origin = rect();
290
+ if (!movable() || event.button !== 0 || event.target.closest("button:not([data-window-move])")) return;
291
+ const origin = frameRect();
292
+ if (!origin) return;
137
293
  const start = {
138
294
  x: event.clientX,
139
295
  y: event.clientY
140
296
  };
141
297
  front();
142
- const move = next => setRect(fit({
298
+ const move = next => setPlaced(fit({
143
299
  ...origin,
144
300
  x: origin.x + next.clientX - start.x,
145
301
  y: origin.y + next.clientY - start.y
@@ -147,8 +303,10 @@ export default function FloatingWindow(props) {
147
303
  trackPointerInteraction(event, move);
148
304
  event.preventDefault();
149
305
  };
150
- const resizeBy = (edge, deltaX, deltaY) => {
151
- const current = rect();
306
+ const resized = (edge, deltaX, deltaY) => {
307
+ const current = frameRect();
308
+ if (!current) return undefined;
309
+ const area = bounds();
152
310
  let {
153
311
  x,
154
312
  y,
@@ -156,33 +314,34 @@ export default function FloatingWindow(props) {
156
314
  height
157
315
  } = current;
158
316
  if (edge.includes("left")) {
159
- const next = clamp(width - deltaX, minWidth(), window.innerWidth - FLOATING_WINDOW_VIEWPORT_GAP - x);
317
+ const next = clamp(width - deltaX, minWidth(), area.x + area.width - FLOATING_WINDOW_VIEWPORT_GAP - x);
160
318
  x += width - next;
161
319
  width = next;
162
320
  }
163
321
  if (edge.includes("right")) width += deltaX;
164
322
  if (edge.includes("top")) {
165
- const next = clamp(height - deltaY, minHeight(), window.innerHeight - FLOATING_WINDOW_VIEWPORT_GAP - y);
323
+ const next = clamp(height - deltaY, minHeight(), area.y + area.height - FLOATING_WINDOW_VIEWPORT_GAP - y);
166
324
  y += height - next;
167
325
  height = next;
168
326
  }
169
327
  if (edge.includes("bottom")) height += deltaY;
170
- setRect(fit({
328
+ return fit({
171
329
  x,
172
330
  y,
173
331
  width,
174
332
  height
175
- }));
333
+ });
176
334
  };
177
335
  const beginResize = (edge, event) => {
178
- if (mobile() || event.button !== 0) return;
336
+ if (!movable() || event.button !== 0) return;
179
337
  let previous = {
180
338
  x: event.clientX,
181
339
  y: event.clientY
182
340
  };
183
341
  front();
184
342
  const move = next => {
185
- resizeBy(edge, next.clientX - previous.x, next.clientY - previous.y);
343
+ const rect = resized(edge, next.clientX - previous.x, next.clientY - previous.y);
344
+ if (rect) setPlaced(rect);
186
345
  previous = {
187
346
  x: next.clientX,
188
347
  y: next.clientY
@@ -192,6 +351,7 @@ export default function FloatingWindow(props) {
192
351
  event.preventDefault();
193
352
  };
194
353
  const arrows = (event, action) => {
354
+ if (!movable()) return;
195
355
  const step = event.shiftKey ? 24 : 8;
196
356
  const delta = event.key === "ArrowLeft" ? [-step, 0] : event.key === "ArrowRight" ? [step, 0] : event.key === "ArrowUp" ? [0, -step] : event.key === "ArrowDown" ? [0, step] : undefined;
197
357
  if (!delta) return;
@@ -199,36 +359,89 @@ export default function FloatingWindow(props) {
199
359
  event.preventDefault();
200
360
  };
201
361
  const handles = [["left", "ew-resize"], ["right", "ew-resize"], ["top", "ns-resize"], ["bottom", "ns-resize"], ["top-left", "nwse-resize"], ["top-right", "nesw-resize"], ["bottom-left", "nesw-resize"], ["bottom-right", "nwse-resize"]];
202
- const view = _$ssr(_tmpl$, `k2b-floating-window ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-mobile", mobile() ? "true" : _$escape(undefined, true), false), _$ssrStyle(mobile() ? {
203
- "--k2b-window-accent": props.accent,
204
- inset: "0.5rem",
205
- width: "auto",
206
- height: "auto",
207
- "z-index": layer()
208
- } : {
209
- "--k2b-window-accent": props.accent,
210
- left: `${rect().x}px`,
211
- top: `${rect().y}px`,
212
- width: `${rect().width}px`,
213
- height: `${rect().height}px`,
214
- "z-index": layer()
215
- }), _$ssrAttribute("aria-labelledby", _$escape(titleId, true), false), _$escape(_$createComponent(Show, {
362
+ const titleLabel = () => state() === "minimized" ? floatingWindowMessages().restoreWindow({
363
+ title: props.title
364
+ }) : movable() ? floatingWindowMessages().moveWindow({
365
+ title: props.title
366
+ }) : props.title;
367
+ const view = [_$createComponent(Show, {
368
+ get when() {
369
+ return _$memo(() => state() === "maximized")() && !mobile();
370
+ },
371
+ get children() {
372
+ return _$ssr(_tmpl$, _$ssrStyleProperty("left:", `${_$escape(bounds().x, true)}px`) + _$ssrStyleProperty(";top:", `${_$escape(bounds().y, true)}px`) + _$ssrStyleProperty(";width:", `${_$escape(bounds().width, true)}px`) + _$ssrStyleProperty(";height:", `${_$escape(bounds().height, true)}px`) + _$ssrStyleProperty(";border-radius:", _$escape(bounds().radius, true)) + _$ssrStyleProperty(";z-index:", _$escape(layer(), true)));
373
+ }
374
+ }), _$ssr(_tmpl$7, `k2b-floating-window ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-mobile", mobile() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-state", _$escape(state(), true), false), _$ssrStyleProperty("--k2b-window-accent:", _$escape(props.accent, true)) + _$ssrStyleProperty(";left:", frameRect() ? `${_$escape(frameRect().x, true)}px` : _$escape(undefined, true)) + _$ssrStyleProperty(";top:", frameRect() ? `${_$escape(frameRect().y, true)}px` : _$escape(undefined, true)) + _$ssrStyleProperty(";width:", frameRect() ? `${_$escape(frameRect().width, true)}px` : _$escape(undefined, true)) + _$ssrStyleProperty(";height:", frameRect() ? `${_$escape(frameRect().height, true)}px` : _$escape(undefined, true)) + _$ssrStyleProperty(";z-index:", _$escape(layer(), true)), _$ssrAttribute("aria-modal", modal() ? "true" : "false", false) + _$ssrAttribute("aria-labelledby", _$escape(titleId, true), false), _$escape(_$createComponent(Show, {
216
375
  get when() {
217
376
  return props.icon;
218
377
  },
219
- children: icon => _$ssr(_tmpl$2, _$ssrAttribute("class", _$escape(icon(), true), false))
220
- })), _$ssrAttribute("aria-label", _$escape(floatingWindowMessages().moveWindow({
221
- title: props.title
222
- }), true), false), _$ssrAttribute("id", _$escape(titleId, true), false), _$escape(props.title), _$ssrAttribute("aria-label", _$escape(floatingWindowMessages().closeWindow, true), false), _$escape(props.children), _$escape(_$createComponent(Show, {
378
+ children: icon => _$ssr(_tmpl$5, _$ssrAttribute("class", _$escape(icon(), true), false))
379
+ })), _$ssrAttribute("aria-label", _$escape(titleLabel(), true), false), _$ssrAttribute("id", _$escape(titleId, true), false), _$escape(props.title), _$escape(_$createComponent(Show, {
380
+ get when() {
381
+ return _$memo(() => props.status !== undefined)() && state() !== "minimized";
382
+ },
383
+ get children() {
384
+ return _$ssr(_tmpl$2, _$escape(props.status));
385
+ }
386
+ })), _$escape(_$createComponent(Show, {
387
+ get when() {
388
+ return _$memo(() => props.actions !== undefined)() && state() !== "minimized";
389
+ },
390
+ get children() {
391
+ return _$ssr(_tmpl$3, _$escape(props.actions));
392
+ }
393
+ })), _$escape(_$createComponent(Show, {
223
394
  get when() {
224
395
  return !mobile();
225
396
  },
226
397
  get children() {
227
- return handles.map(([edge, cursor]) => edge === "bottom-right" ? _$ssr(_tmpl$3, _$ssrAttribute("data-edge", _$escape(edge, true), false), _$ssrStyleProperty("cursor:", _$escape(cursor, true)), _$ssrAttribute("aria-label", _$escape(floatingWindowMessages().resizeWindow, true), false)) : // Cloud exposes a single keyboard-resizable corner; the remaining
398
+ return [_$createComponent(Show, {
399
+ get when() {
400
+ return state() !== "minimized";
401
+ },
402
+ get children() {
403
+ return _$createComponent(IconButton, {
404
+ size: "sm",
405
+ get label() {
406
+ return floatingWindowMessages().minimizeWindow;
407
+ },
408
+ onClick: () => changeState("minimized"),
409
+ get children() {
410
+ return _$ssr(_tmpl$4);
411
+ }
412
+ });
413
+ }
414
+ }), _$createComponent(IconButton, {
415
+ size: "sm",
416
+ get label() {
417
+ return _$memo(() => state() === "maximized")() ? floatingWindowMessages().restoreSize : floatingWindowMessages().maximizeWindow;
418
+ },
419
+ onClick: () => changeState(state() === "maximized" ? "normal" : "maximized"),
420
+ get children() {
421
+ return _$ssr(_tmpl$5, _$ssrAttribute("class", state() === "maximized" ? "ti ti-arrows-diagonal-minimize-2" : "ti ti-arrows-diagonal", false));
422
+ }
423
+ })];
424
+ }
425
+ })), _$escape(_$createComponent(IconButton, {
426
+ size: "sm",
427
+ "class": "k2b-floating-window__close",
428
+ get label() {
429
+ return floatingWindowMessages().closeWindow;
430
+ },
431
+ onClick: close,
432
+ get children() {
433
+ return _$ssr(_tmpl$6);
434
+ }
435
+ })), _$escape(props.children), _$escape(_$createComponent(Show, {
436
+ get when() {
437
+ return movable();
438
+ },
439
+ get children() {
440
+ return handles.map(([edge, cursor]) => edge === "bottom-right" ? _$ssr(_tmpl$8, _$ssrAttribute("data-edge", _$escape(edge, true), false), _$ssrStyleProperty("cursor:", _$escape(cursor, true)), _$ssrAttribute("aria-label", _$escape(floatingWindowMessages().resizeWindow, true), false)) : // Cloud exposes a single keyboard-resizable corner; the remaining
228
441
  // edges stay pointer-only so the window adds one tab stop, not eight.
229
- _$ssr(_tmpl$4, _$ssrAttribute("data-edge", _$escape(edge, true), false), _$ssrStyleProperty("cursor:", _$escape(cursor, true))));
442
+ _$ssr(_tmpl$9, _$ssrAttribute("data-edge", _$escape(edge, true), false), _$ssrStyleProperty("cursor:", _$escape(cursor, true))));
230
443
  }
231
- })));
444
+ })))];
232
445
  return _$createComponent(Portal, {
233
446
  get mount() {
234
447
  return typeof document === "undefined" ? undefined : getK2bPortalRoot(props.resolveScope?.());