@operato/layout 10.29.46 → 10.29.50
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/CHANGELOG.md +26 -0
- package/dist/src/actions/entity360-door.d.ts +28 -0
- package/dist/src/actions/entity360-door.js +45 -0
- package/dist/src/actions/entity360-door.js.map +1 -1
- package/dist/src/actions/entity360-registry.d.ts +13 -3
- package/dist/src/actions/entity360-registry.js +49 -8
- package/dist/src/actions/entity360-registry.js.map +1 -1
- package/dist/src/actions/entity360.d.ts +2 -0
- package/dist/src/actions/entity360.js +4 -0
- package/dist/src/actions/entity360.js.map +1 -1
- package/dist/src/actions/id-lens.d.ts +67 -0
- package/dist/src/actions/id-lens.js +51 -0
- package/dist/src/actions/id-lens.js.map +1 -0
- package/dist/src/actions/layout.d.ts +5 -0
- package/dist/src/actions/layout.js.map +1 -1
- package/dist/src/components/ox-entity360-dock.d.ts +18 -2
- package/dist/src/components/ox-entity360-dock.js +39 -17
- package/dist/src/components/ox-entity360-dock.js.map +1 -1
- package/dist/src/components/ox-id-lens.d.ts +58 -0
- package/dist/src/components/ox-id-lens.js +362 -0
- package/dist/src/components/ox-id-lens.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/layouts/ox-aside-bar.js +134 -6
- package/dist/src/layouts/ox-aside-bar.js.map +1 -1
- package/dist/test/entity360-companion.test.d.ts +1 -0
- package/dist/test/entity360-companion.test.js +127 -0
- package/dist/test/entity360-companion.test.js.map +1 -0
- package/dist/test/entity360-kind.test.js +136 -10
- package/dist/test/entity360-kind.test.js.map +1 -1
- package/dist/test/entity360-section.test.js +31 -1
- package/dist/test/entity360-section.test.js.map +1 -1
- package/dist/test/entity360.test.js +29 -6
- package/dist/test/entity360.test.js.map +1 -1
- package/dist/test/id-lens.test.d.ts +2 -0
- package/dist/test/id-lens.test.js +162 -0
- package/dist/test/id-lens.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -6
- package/test/entity360-companion.test.ts +110 -0
- package/test/entity360-kind.test.ts +145 -11
- package/test/entity360-section.test.ts +34 -1
- package/test/entity360.test.ts +31 -6
- package/test/id-lens.test.ts +198 -0
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -1136
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -63268
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/actions/layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAgB,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAE3G,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAmC7D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACnF,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,eAAe;QACrB,IAAI;QACJ,QAAQ,EAAE;YACR,GAAG,QAAQ;YACX,IAAI,EAAE,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI;SACjE;QACD,QAAQ;KACT,CAAC,CAAA;IAEF,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvC,WAAW,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC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5F,OAAO,YAAY,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;QACD,MAAM,EAAE,KAAK;KACd,CAAA;IAED,QAAQ,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,QAAQ,CAAC,CAAC;QAC7D,IAAI,IAAI,IAAK,CAAiB,CAAC,MAAM,EAAE,CAAC;YACtC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAA;YACnB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAA;YAClC,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,0BAA0B,CAAC,iBAAiB,CAAC,CAAA;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAA","sourcesContent":["import { TemplateResult } from 'lit'\n\nimport { openPopup as openPopupWithResult, PopupOptions, setOpenPopupImplementation } from '@operato/popup'\nimport { PopupImplementationHandle } from '@operato/popup/implementation.js'\nimport { store } from '@operato/shell'\nimport { addressController } from '@operato/utils/address.js'\n\nexport type Viewpart = {\n hovering?: 'center' | 'edge' | 'next'\n show?: boolean\n size?: string\n title?: string\n help?: string\n level?: VIEWPART_LEVEL\n closable?: boolean\n search?: {\n value?: string\n handler?: (closure: any, value: string) => void\n placeholder?: string\n }\n filter?: {\n handler?: (closure: any) => void\n }\n backdrop?: boolean\n temporary?: boolean /* auto remove */\n persistent?: boolean /* application-wide dock remains available in fullbleed pages */\n resizable?: boolean\n movable?: boolean\n template?: TemplateResult\n position?: VIEWPART_POSITION\n templateProperties?: any\n zIndex?: number\n}\n\nexport type AppendViewpartAction = {\n name: string\n viewpart: Viewpart\n position: VIEWPART_POSITION\n}\n\nexport const appendViewpart = ({ name, viewpart, position }: AppendViewpartAction) => {\n store.dispatch({\n type: APPEND_VIEWPART,\n name,\n viewpart: {\n ...viewpart,\n show: viewpart.hovering && viewpart.show ? false : viewpart.show\n },\n position\n })\n\n if (viewpart.hovering && viewpart.show) {\n openOverlay(name)\n }\n}\n\nexport const removeViewpart = (name: string) => {\n store.dispatch({\n type: REMOVE_VIEWPART,\n name\n })\n}\n\nexport const updateViewpart = (name: string, override: any) => {\n store.dispatch({\n type: UPDATE_VIEWPART,\n name,\n override\n })\n}\n\nexport const APPEND_VIEWPART = 'APPEND_VIEWPART'\nexport const REMOVE_VIEWPART = 'REMOVE_VIEWPART'\nexport const UPDATE_VIEWPART = 'UPDATE_VIEWPART'\n\nexport enum VIEWPART_POSITION {\n HEADERBAR = 'headerbar',\n NAVBAR = 'navbar',\n ASIDEBAR = 'asidebar',\n FOOTERBAR = 'footerbar',\n PAGE_HEADERBAR = 'page-headerbar',\n PAGE_FOOTERBAR = 'page-footerbar'\n}\n\n/**\n * 각 뷰파트 스택의 순서를 정하는 속성이다.\n * 뷰파트의 level 속성에 정의되도록 한다.\n * 맨 위/아래/좌측/우측에 보여져야하는 뷰파트는 TOPMOST 속성을 갖도록 하고,\n * 쌓인 순서대로 보여지는 뷰파트는 NORMAL 속성을 갖도록 한다.\n * default 속성은 NORMAL이다.\n */\nexport enum VIEWPART_LEVEL {\n TOPMOST = 'TOPMOST',\n NORMAL = 'NORMAL'\n}\n\nexport enum TOOL_POSITION {\n FRONT_END = 'FRONT_END',\n FRONT = 'FRONT',\n CENTER = 'CENTER',\n REAR = 'REAR',\n REAR_END = 'REAR_END'\n}\n\nexport const UPDATE_VIEWPORT_WIDTH = 'UPDATE_VIEWPORT_WIDTH'\n\nexport const updateLayout = (wide?: boolean) => {\n store.dispatch({\n type: UPDATE_VIEWPORT_WIDTH,\n width: wide ? 'WIDE' : 'NARROW'\n })\n}\n\n/* overlay navigation */\nvar overlaySequence = 0\nconst pendingOverlays = new Map<string, AbortController>()\nconst overlays: { name: string; key: string; belowKey: string; escapable: boolean }[] = []\n\nfunction syncModal() {\n const modal = [...overlays]\n .reverse()\n .find(overlay => (store.getState() as any).layout?.viewparts?.[overlay.name]?.backdrop)\n addressController().setModal(modal ? { name: modal.name, close: () => dismissOverlays(0) } : undefined)\n}\n\nfunction dismissOverlays(from: number) {\n for (const overlay of overlays.splice(from)) {\n store.dispatch({ type: UPDATE_VIEWPART, name: overlay.name, override: { show: false } })\n }\n syncModal()\n}\n\naddressController().subscribe((entry, before) => {\n const firstGone = overlays.findIndex(overlay => {\n const index = addressController().indexOf(overlay.key)\n return index < 0 || index > entry.index\n })\n if (firstGone >= 0) dismissOverlays(firstGone)\n if (entry.url.pathname !== before.url.pathname || entry.intent === 'navigation') dismissOverlays(0)\n const overlay = (entry.state as any)?.overlay\n if (!overlay || !pendingOverlays.has(overlay.name)) return\n pendingOverlays.delete(overlay.name)\n overlays.push({ ...overlay, key: entry.key, belowKey: before.key })\n store.dispatch({ type: UPDATE_VIEWPART, name: overlay.name, override: { show: true } })\n syncModal()\n}, false)\n\n/* An overlay hidden by any other way (a viewpart update, its removal) is closed: the stack is what is on screen. */\nstore.subscribe(() => {\n const viewparts = (store.getState() as any).layout?.viewparts || {}\n const hidden = overlays.find(overlay => !viewparts[overlay.name]?.show)\n if (hidden) closeOverlay(hidden.name)\n})\n\ndocument.addEventListener('keydown', event => {\n const top = overlays[overlays.length - 1]\n if (top?.escapable && (event.key === 'Escape' || event.key === 'Esc')) {\n event.preventDefault()\n closeOverlay(top.name)\n }\n})\n\nexport const openOverlay = (name: string, options?: any, silent?: boolean) => {\n /* store의 layout의 내용을 변경한다. */\n if (!silent && options) {\n store.dispatch({\n type: UPDATE_VIEWPART,\n name,\n override: options\n })\n }\n\n const request = new AbortController()\n pendingOverlays.set(name, request)\n void addressController()\n .pushOverlay(\n {\n ...(history.state || {}),\n overlay: { name, sequence: ++overlaySequence, escapable: options?.escapable !== false }\n },\n request.signal\n )\n .then(accepted => {\n if (accepted) return\n pendingOverlays.delete(name)\n store.dispatch({ type: UPDATE_VIEWPART, name, override: { show: false } })\n document.dispatchEvent(new CustomEvent('overlay-closed', { detail: name }))\n })\n}\n\nexport const closeOverlay = (name: string) => {\n const index = overlays.findIndex(overlay => overlay.name === name)\n if (index < 0) {\n const pending = pendingOverlays.get(name)\n pending?.abort()\n return !!pending\n }\n const overlay = overlays[index]\n dismissOverlays(index)\n // Back to the entry under the overlay only when nothing with another address was written above it. If something\n // was (a filter while the AI dock was open), the overlay is only hidden: going back would undo that write.\n if (addressController().unchangedSince(overlay.key)) addressController().traverseTo(overlay.belowKey)\n return true\n}\n\n/** The overlay on top of the ones open now, if any - what a back control in the app's own bar closes. */\nexport const topOverlay = (): string | undefined => overlays[overlays.length - 1]?.name\n\nexport const toggleOverlay = (name: string, options: any) => {\n var beforeOverlayName = overlays[overlays.length - 1]?.name\n\n if (beforeOverlayName == name) {\n closeOverlay(name)\n } else {\n openOverlay(name, options)\n }\n}\n\n/*\n * popup handling\n *\n * popup은 overlay의 특별한 형태이다.\n * popup은 open될 때, viewpart를 append 하며, close 될 때 viewpart를 remove 한다.\n * - name: '$popup-${popupSequence}'\n * - position: VIEWPART_POSITION_HEADERBAR\n * - hovering: 'center' | 'next' | 'edge'\n */\nvar popupSequence = 0\n\n/**\n * open popup in operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns the implementation handle. Callers get the full handle (with `result`) from `openPopup`.\n */\nconst openPopupInLayout = (template: TemplateResult, options: PopupOptions = {}): PopupImplementationHandle => {\n var name = `$popup-${popupSequence++}`\n\n appendViewpart({\n name,\n viewpart: {\n hovering: 'center',\n closable: true,\n movable: true,\n ...options,\n /* A popup is modal unless the caller asks for none: a window that works with what is behind it (a figure's fastening, pressed on the canvas) lays no backdrop. */\n backdrop: options.backdrop ?? true,\n show: false,\n temporary: true /* auto remove */,\n template\n },\n position: VIEWPART_POSITION.HEADERBAR\n })\n\n openOverlay(name, options, true)\n\n /* Typed, not cast: a cast would let a close() that forgets to answer compile. */\n var popup: PopupImplementationHandle = {\n name,\n close: () => {\n if (overlays[overlays.length - 1]?.name !== name && !pendingOverlays.has(name)) return false\n return closeOverlay(name)\n },\n closed: false\n }\n\n document.addEventListener('overlay-closed', function listener(e) {\n if (name == (e as CustomEvent).detail) {\n popup.closed = true\n popup.onclosed && popup.onclosed()\n document.removeEventListener('overlay-closed', listener)\n }\n })\n\n return popup\n}\n\nsetOpenPopupImplementation(openPopupInLayout)\n\n/*\n * The popup package's openPopup adds `result` and `close(result)` on top of whichever implementation is\n * registered, so the handle is built in one place. Re-exported here because most callers import\n * openPopup from @operato/layout.\n */\nexport const openPopup = openPopupWithResult\n"]}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/actions/layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAgB,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAE3G,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAqC7D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACnF,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,eAAe;QACrB,IAAI;QACJ,QAAQ,EAAE;YACR,GAAG,QAAQ;YACX,IAAI,EAAE,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI;SACjE;QACD,QAAQ;KACT,CAAC,CAAA;IAEF,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvC,WAAW,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;IAC7C,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EA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ED,QAAQ,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,QAAQ,CAAC,CAAC;QAC7D,IAAI,IAAI,IAAK,CAAiB,CAAC,MAAM,EAAE,CAAC;YACtC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAA;YACnB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAA;YAClC,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,0BAA0B,CAAC,iBAAiB,CAAC,CAAA;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAA","sourcesContent":["import { TemplateResult } from 'lit'\n\nimport { openPopup as openPopupWithResult, PopupOptions, setOpenPopupImplementation } from '@operato/popup'\nimport { PopupImplementationHandle } from '@operato/popup/implementation.js'\nimport { store } from '@operato/shell'\nimport { addressController } from '@operato/utils/address.js'\n\nexport type Viewpart = {\n hovering?: 'center' | 'edge' | 'next'\n show?: boolean\n size?: string\n title?: string\n help?: string\n level?: VIEWPART_LEVEL\n closable?: boolean\n search?: {\n value?: string\n handler?: (closure: any, value: string) => void\n placeholder?: string\n }\n filter?: {\n handler?: (closure: any) => void\n }\n backdrop?: boolean\n temporary?: boolean /* auto remove */\n /** An already open supporting dock can share the expanded entity workspace. No product content is owned here. */\n expansionCompanion?: { labelKey: string; defaultLabel: string }\n persistent?: boolean /* application-wide dock remains available in fullbleed pages */\n resizable?: boolean\n movable?: boolean\n template?: TemplateResult\n position?: VIEWPART_POSITION\n templateProperties?: any\n zIndex?: number\n}\n\nexport type AppendViewpartAction = {\n name: string\n viewpart: Viewpart\n position: VIEWPART_POSITION\n}\n\nexport const appendViewpart = ({ name, viewpart, position }: AppendViewpartAction) => {\n store.dispatch({\n type: APPEND_VIEWPART,\n name,\n viewpart: {\n ...viewpart,\n show: viewpart.hovering && viewpart.show ? false : viewpart.show\n },\n position\n })\n\n if (viewpart.hovering && viewpart.show) {\n openOverlay(name)\n }\n}\n\nexport const removeViewpart = (name: string) => {\n store.dispatch({\n type: REMOVE_VIEWPART,\n name\n })\n}\n\nexport const updateViewpart = (name: string, override: any) => {\n store.dispatch({\n type: UPDATE_VIEWPART,\n name,\n override\n })\n}\n\nexport const APPEND_VIEWPART = 'APPEND_VIEWPART'\nexport const REMOVE_VIEWPART = 'REMOVE_VIEWPART'\nexport const UPDATE_VIEWPART = 'UPDATE_VIEWPART'\n\nexport enum VIEWPART_POSITION {\n HEADERBAR = 'headerbar',\n NAVBAR = 'navbar',\n ASIDEBAR = 'asidebar',\n FOOTERBAR = 'footerbar',\n PAGE_HEADERBAR = 'page-headerbar',\n PAGE_FOOTERBAR = 'page-footerbar'\n}\n\n/**\n * 각 뷰파트 스택의 순서를 정하는 속성이다.\n * 뷰파트의 level 속성에 정의되도록 한다.\n * 맨 위/아래/좌측/우측에 보여져야하는 뷰파트는 TOPMOST 속성을 갖도록 하고,\n * 쌓인 순서대로 보여지는 뷰파트는 NORMAL 속성을 갖도록 한다.\n * default 속성은 NORMAL이다.\n */\nexport enum VIEWPART_LEVEL {\n TOPMOST = 'TOPMOST',\n NORMAL = 'NORMAL'\n}\n\nexport enum TOOL_POSITION {\n FRONT_END = 'FRONT_END',\n FRONT = 'FRONT',\n CENTER = 'CENTER',\n REAR = 'REAR',\n REAR_END = 'REAR_END'\n}\n\nexport const UPDATE_VIEWPORT_WIDTH = 'UPDATE_VIEWPORT_WIDTH'\n\nexport const updateLayout = (wide?: boolean) => {\n store.dispatch({\n type: UPDATE_VIEWPORT_WIDTH,\n width: wide ? 'WIDE' : 'NARROW'\n })\n}\n\n/* overlay navigation */\nvar overlaySequence = 0\nconst pendingOverlays = new Map<string, AbortController>()\nconst overlays: { name: string; key: string; belowKey: string; escapable: boolean }[] = []\n\nfunction syncModal() {\n const modal = [...overlays]\n .reverse()\n .find(overlay => (store.getState() as any).layout?.viewparts?.[overlay.name]?.backdrop)\n addressController().setModal(modal ? { name: modal.name, close: () => dismissOverlays(0) } : undefined)\n}\n\nfunction dismissOverlays(from: number) {\n for (const overlay of overlays.splice(from)) {\n store.dispatch({ type: UPDATE_VIEWPART, name: overlay.name, override: { show: false } })\n }\n syncModal()\n}\n\naddressController().subscribe((entry, before) => {\n const firstGone = overlays.findIndex(overlay => {\n const index = addressController().indexOf(overlay.key)\n return index < 0 || index > entry.index\n })\n if (firstGone >= 0) dismissOverlays(firstGone)\n if (entry.url.pathname !== before.url.pathname || entry.intent === 'navigation') dismissOverlays(0)\n const overlay = (entry.state as any)?.overlay\n if (!overlay || !pendingOverlays.has(overlay.name)) return\n pendingOverlays.delete(overlay.name)\n overlays.push({ ...overlay, key: entry.key, belowKey: before.key })\n store.dispatch({ type: UPDATE_VIEWPART, name: overlay.name, override: { show: true } })\n syncModal()\n}, false)\n\n/* An overlay hidden by any other way (a viewpart update, its removal) is closed: the stack is what is on screen. */\nstore.subscribe(() => {\n const viewparts = (store.getState() as any).layout?.viewparts || {}\n const hidden = overlays.find(overlay => !viewparts[overlay.name]?.show)\n if (hidden) closeOverlay(hidden.name)\n})\n\ndocument.addEventListener('keydown', event => {\n const top = overlays[overlays.length - 1]\n if (top?.escapable && (event.key === 'Escape' || event.key === 'Esc')) {\n event.preventDefault()\n closeOverlay(top.name)\n }\n})\n\nexport const openOverlay = (name: string, options?: any, silent?: boolean) => {\n /* store의 layout의 내용을 변경한다. */\n if (!silent && options) {\n store.dispatch({\n type: UPDATE_VIEWPART,\n name,\n override: options\n })\n }\n\n const request = new AbortController()\n pendingOverlays.set(name, request)\n void addressController()\n .pushOverlay(\n {\n ...(history.state || {}),\n overlay: { name, sequence: ++overlaySequence, escapable: options?.escapable !== false }\n },\n request.signal\n )\n .then(accepted => {\n if (accepted) return\n pendingOverlays.delete(name)\n store.dispatch({ type: UPDATE_VIEWPART, name, override: { show: false } })\n document.dispatchEvent(new CustomEvent('overlay-closed', { detail: name }))\n })\n}\n\nexport const closeOverlay = (name: string) => {\n const index = overlays.findIndex(overlay => overlay.name === name)\n if (index < 0) {\n const pending = pendingOverlays.get(name)\n pending?.abort()\n return !!pending\n }\n const overlay = overlays[index]\n dismissOverlays(index)\n // Back to the entry under the overlay only when nothing with another address was written above it. If something\n // was (a filter while the AI dock was open), the overlay is only hidden: going back would undo that write.\n if (addressController().unchangedSince(overlay.key)) addressController().traverseTo(overlay.belowKey)\n return true\n}\n\n/** The overlay on top of the ones open now, if any - what a back control in the app's own bar closes. */\nexport const topOverlay = (): string | undefined => overlays[overlays.length - 1]?.name\n\nexport const toggleOverlay = (name: string, options: any) => {\n var beforeOverlayName = overlays[overlays.length - 1]?.name\n\n if (beforeOverlayName == name) {\n closeOverlay(name)\n } else {\n openOverlay(name, options)\n }\n}\n\n/*\n * popup handling\n *\n * popup은 overlay의 특별한 형태이다.\n * popup은 open될 때, viewpart를 append 하며, close 될 때 viewpart를 remove 한다.\n * - name: '$popup-${popupSequence}'\n * - position: VIEWPART_POSITION_HEADERBAR\n * - hovering: 'center' | 'next' | 'edge'\n */\nvar popupSequence = 0\n\n/**\n * open popup in operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns the implementation handle. Callers get the full handle (with `result`) from `openPopup`.\n */\nconst openPopupInLayout = (template: TemplateResult, options: PopupOptions = {}): PopupImplementationHandle => {\n var name = `$popup-${popupSequence++}`\n\n appendViewpart({\n name,\n viewpart: {\n hovering: 'center',\n closable: true,\n movable: true,\n ...options,\n /* A popup is modal unless the caller asks for none: a window that works with what is behind it (a figure's fastening, pressed on the canvas) lays no backdrop. */\n backdrop: options.backdrop ?? true,\n show: false,\n temporary: true /* auto remove */,\n template\n },\n position: VIEWPART_POSITION.HEADERBAR\n })\n\n openOverlay(name, options, true)\n\n /* Typed, not cast: a cast would let a close() that forgets to answer compile. */\n var popup: PopupImplementationHandle = {\n name,\n close: () => {\n if (overlays[overlays.length - 1]?.name !== name && !pendingOverlays.has(name)) return false\n return closeOverlay(name)\n },\n closed: false\n }\n\n document.addEventListener('overlay-closed', function listener(e) {\n if (name == (e as CustomEvent).detail) {\n popup.closed = true\n popup.onclosed && popup.onclosed()\n document.removeEventListener('overlay-closed', listener)\n }\n })\n\n return popup\n}\n\nsetOpenPopupImplementation(openPopupInLayout)\n\n/*\n * The popup package's openPopup adds `result` and `close(result)` on top of whichever implementation is\n * registered, so the handle is built in one place. Re-exported here because most callers import\n * openPopup from @operato/layout.\n */\nexport const openPopup = openPopupWithResult\n"]}
|
|
@@ -18,22 +18,38 @@ export interface Entity360View {
|
|
|
18
18
|
};
|
|
19
19
|
onClose(): void;
|
|
20
20
|
onBack?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Read the same subject again (ADR-0067 decision 8). The contents stay - what a section is writing stays with it;
|
|
23
|
+
* each section asks its door anew. Without it the refresh button is not drawn.
|
|
24
|
+
*/
|
|
25
|
+
onRefresh?: () => void;
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* A section tells the dock it holds an entry this browser cannot keep as a draft (ADR-0067 decision 8, ADR-0098
|
|
29
|
+
* decision 5): `detail.unkept` true while so, false once saved, discarded or kept. Only then is leaving asked about.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ENTITY360_UNKEPT = "entity360-unkept";
|
|
22
32
|
/** Product CSS stays inside this boundary, never changes the dock's layout or controls. */
|
|
23
33
|
export declare class OxEntity360Content extends LitElement {
|
|
24
34
|
view?: Entity360View;
|
|
25
|
-
revision: number;
|
|
26
35
|
render(): TemplateResult<1>;
|
|
27
36
|
}
|
|
28
37
|
export declare class OxEntity360Dock extends LitElement {
|
|
29
|
-
|
|
38
|
+
/** The sections that hold an entry no draft keeps. */
|
|
39
|
+
private unkeptBy;
|
|
40
|
+
private onUnkept;
|
|
41
|
+
/** Whether leaving this subject would lose an entry without a word - a draft keeps all the others. */
|
|
42
|
+
get unkept(): boolean;
|
|
30
43
|
static styles: CSSResult[];
|
|
31
44
|
view?: Entity360View;
|
|
32
45
|
expanded: boolean;
|
|
46
|
+
/** The aside workspace owns layout and keyboard boundaries while a companion is visible. */
|
|
47
|
+
contained: boolean;
|
|
33
48
|
private width;
|
|
34
49
|
private media;
|
|
35
50
|
private compact;
|
|
36
51
|
private onMedia;
|
|
52
|
+
get fullscreen(): boolean;
|
|
37
53
|
private dragStart?;
|
|
38
54
|
private onEscape;
|
|
39
55
|
connectedCallback(): void;
|
|
@@ -6,23 +6,21 @@ import { keyed } from 'lit/directives/keyed.js';
|
|
|
6
6
|
import { i18next } from '@operato/i18n';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
|
+
/**
|
|
10
|
+
* A section tells the dock it holds an entry this browser cannot keep as a draft (ADR-0067 decision 8, ADR-0098
|
|
11
|
+
* decision 5): `detail.unkept` true while so, false once saved, discarded or kept. Only then is leaving asked about.
|
|
12
|
+
*/
|
|
13
|
+
export const ENTITY360_UNKEPT = 'entity360-unkept';
|
|
9
14
|
/** Product CSS stays inside this boundary, never changes the dock's layout or controls. */
|
|
10
15
|
let OxEntity360Content = class OxEntity360Content extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.revision = 0;
|
|
14
|
-
}
|
|
15
16
|
render() {
|
|
16
17
|
var _a, _b, _c, _d;
|
|
17
|
-
return html `<style>${((_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.styles) !== null && _b !== void 0 ? _b : []).map(style => style.cssText).join('\n')}</style>${keyed(
|
|
18
|
+
return html `<style>${((_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.styles) !== null && _b !== void 0 ? _b : []).map(style => style.cssText).join('\n')}</style>${keyed((_c = this.view) === null || _c === void 0 ? void 0 : _c.key, (_d = this.view) === null || _d === void 0 ? void 0 : _d.content)}`;
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
__decorate([
|
|
21
22
|
property({ attribute: false })
|
|
22
23
|
], OxEntity360Content.prototype, "view", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
property({ type: Number })
|
|
25
|
-
], OxEntity360Content.prototype, "revision", void 0);
|
|
26
24
|
OxEntity360Content = __decorate([
|
|
27
25
|
customElement('ox-entity360-content')
|
|
28
26
|
], OxEntity360Content);
|
|
@@ -30,8 +28,19 @@ export { OxEntity360Content };
|
|
|
30
28
|
let OxEntity360Dock = class OxEntity360Dock extends LitElement {
|
|
31
29
|
constructor() {
|
|
32
30
|
super(...arguments);
|
|
33
|
-
|
|
31
|
+
/** The sections that hold an entry no draft keeps. */
|
|
32
|
+
this.unkeptBy = new Set();
|
|
33
|
+
this.onUnkept = (event) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const section = event.composedPath()[0];
|
|
36
|
+
if ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.unkept)
|
|
37
|
+
this.unkeptBy.add(section);
|
|
38
|
+
else
|
|
39
|
+
this.unkeptBy.delete(section);
|
|
40
|
+
};
|
|
34
41
|
this.expanded = false;
|
|
42
|
+
/** The aside workspace owns layout and keyboard boundaries while a companion is visible. */
|
|
43
|
+
this.contained = false;
|
|
35
44
|
this.width = 480;
|
|
36
45
|
this.media = matchMedia('(max-width: 900px)');
|
|
37
46
|
this.compact = this.media.matches;
|
|
@@ -39,7 +48,7 @@ let OxEntity360Dock = class OxEntity360Dock extends LitElement {
|
|
|
39
48
|
this.onEscape = (event) => {
|
|
40
49
|
var _a, _b, _c;
|
|
41
50
|
// A modal opened above the nonmodal dock owns Escape until it closes.
|
|
42
|
-
if (event.defaultPrevented || ((_a = history.state) === null || _a === void 0 ? void 0 : _a.overlay))
|
|
51
|
+
if (this.contained || event.defaultPrevented || ((_a = history.state) === null || _a === void 0 ? void 0 : _a.overlay))
|
|
43
52
|
return;
|
|
44
53
|
if (event.key === 'Escape')
|
|
45
54
|
(_b = this.view) === null || _b === void 0 ? void 0 : _b.onClose();
|
|
@@ -57,19 +66,31 @@ let OxEntity360Dock = class OxEntity360Dock extends LitElement {
|
|
|
57
66
|
}
|
|
58
67
|
};
|
|
59
68
|
}
|
|
69
|
+
/** Whether leaving this subject would lose an entry without a word - a draft keeps all the others. */
|
|
70
|
+
get unkept() {
|
|
71
|
+
for (const section of this.unkeptBy)
|
|
72
|
+
if (!section.isConnected)
|
|
73
|
+
this.unkeptBy.delete(section);
|
|
74
|
+
return this.unkeptBy.size > 0;
|
|
75
|
+
}
|
|
76
|
+
get fullscreen() { return this.expanded || this.compact; }
|
|
60
77
|
connectedCallback() {
|
|
61
78
|
super.connectedCallback();
|
|
62
79
|
document.addEventListener('keydown', this.onEscape);
|
|
63
80
|
this.media.addEventListener('change', this.onMedia);
|
|
81
|
+
this.addEventListener(ENTITY360_UNKEPT, this.onUnkept);
|
|
64
82
|
}
|
|
65
83
|
disconnectedCallback() {
|
|
66
84
|
document.removeEventListener('keydown', this.onEscape);
|
|
67
85
|
this.media.removeEventListener('change', this.onMedia);
|
|
86
|
+
this.removeEventListener(ENTITY360_UNKEPT, this.onUnkept);
|
|
68
87
|
super.disconnectedCallback();
|
|
69
88
|
}
|
|
70
89
|
firstUpdated() { this.focusHeading(); }
|
|
71
90
|
updated(changes) {
|
|
72
91
|
var _a, _b;
|
|
92
|
+
if (changes.has('expanded') || changes.has('compact') || changes.has('view'))
|
|
93
|
+
this.dispatchEvent(new CustomEvent('entity360-presentation', { bubbles: true, composed: true }));
|
|
73
94
|
const previous = changes.get('view');
|
|
74
95
|
if (changes.has('view') && (previous === null || previous === void 0 ? void 0 : previous.key) !== ((_a = this.view) === null || _a === void 0 ? void 0 : _a.key)) {
|
|
75
96
|
(_b = this.renderRoot.querySelector('.body')) === null || _b === void 0 ? void 0 : _b.scrollTo(0, 0);
|
|
@@ -85,7 +106,7 @@ let OxEntity360Dock = class OxEntity360Dock extends LitElement {
|
|
|
85
106
|
const view = this.view;
|
|
86
107
|
if (!view)
|
|
87
108
|
return html ``;
|
|
88
|
-
const fullscreen = this.
|
|
109
|
+
const fullscreen = !this.contained && this.fullscreen;
|
|
89
110
|
return html `<aside role=${fullscreen ? 'dialog' : 'complementary'} aria-modal=${ifDefined(fullscreen ? 'true' : undefined)} aria-labelledby="entity360-title">
|
|
90
111
|
<div class="resize" role="separator" tabindex="0" aria-orientation="vertical"
|
|
91
112
|
aria-label=${view.labels.resize} aria-valuemin="320" aria-valuemax=${Math.min(innerWidth * .65, 960)} aria-valuenow=${this.width}
|
|
@@ -108,14 +129,14 @@ let OxEntity360Dock = class OxEntity360Dock extends LitElement {
|
|
|
108
129
|
<header>
|
|
109
130
|
${view.onBack ? html `<button data-action="back" aria-label=${view.labels.back} title=${view.labels.back} @click=${view.onBack}><md-icon aria-hidden="true">arrow_back</md-icon></button>` : ''}
|
|
110
131
|
<div class="heading" aria-live="polite"><h2 id="entity360-title" tabindex="-1">${view.title}</h2><p>${view.context}</p></div>
|
|
111
|
-
|
|
112
|
-
title=${(_b = view.labels.refresh) !== null && _b !== void 0 ? _b : i18next.t('button.refresh')} @click=${
|
|
132
|
+
${view.onRefresh ? html `<button data-action="refresh" aria-label=${(_a = view.labels.refresh) !== null && _a !== void 0 ? _a : i18next.t('button.refresh')}
|
|
133
|
+
title=${(_b = view.labels.refresh) !== null && _b !== void 0 ? _b : i18next.t('button.refresh')} @click=${view.onRefresh}><md-icon aria-hidden="true">refresh</md-icon></button>` : ''}
|
|
113
134
|
<button class="expand" data-action="expand" aria-label=${this.expanded ? view.labels.collapse : view.labels.expand}
|
|
114
135
|
title=${this.expanded ? view.labels.collapse : view.labels.expand} aria-pressed=${this.expanded}
|
|
115
136
|
@click=${() => { this.expanded = !this.expanded; }}><md-icon aria-hidden="true">${this.expanded ? 'fullscreen_exit' : 'fullscreen'}</md-icon></button>
|
|
116
137
|
<button data-action="close" aria-label=${view.labels.close} title=${view.labels.close} @click=${view.onClose}><md-icon aria-hidden="true">close</md-icon></button>
|
|
117
138
|
</header>
|
|
118
|
-
<div class="body"><ox-entity360-content .view=${view}
|
|
139
|
+
<div class="body"><ox-entity360-content .view=${view}></ox-entity360-content></div>
|
|
119
140
|
</aside>`;
|
|
120
141
|
}
|
|
121
142
|
};
|
|
@@ -145,17 +166,18 @@ OxEntity360Dock.styles = [ScrollbarStyles, css `
|
|
|
145
166
|
:host { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; z-index: 901; }
|
|
146
167
|
.resize, .expand { display: none; }
|
|
147
168
|
}
|
|
169
|
+
:host([contained]) { position: relative; inset: auto; width: 100%; max-width: none; height: 100%; z-index: auto; }
|
|
148
170
|
@media (pointer: coarse) { button { width: 40px; height: 40px; } }
|
|
149
171
|
`];
|
|
150
|
-
__decorate([
|
|
151
|
-
state()
|
|
152
|
-
], OxEntity360Dock.prototype, "revision", void 0);
|
|
153
172
|
__decorate([
|
|
154
173
|
property({ attribute: false })
|
|
155
174
|
], OxEntity360Dock.prototype, "view", void 0);
|
|
156
175
|
__decorate([
|
|
157
176
|
property({ type: Boolean, reflect: true })
|
|
158
177
|
], OxEntity360Dock.prototype, "expanded", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ type: Boolean, reflect: true })
|
|
180
|
+
], OxEntity360Dock.prototype, "contained", void 0);
|
|
159
181
|
__decorate([
|
|
160
182
|
state()
|
|
161
183
|
], OxEntity360Dock.prototype, "width", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-entity360-dock.js","sourceRoot":"","sources":["../../../src/components/ox-entity360-dock.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuC,MAAM,KAAK,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,O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Ae,CA6G3B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { LitElement, css, html, type CSSResult, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { i18next } from '@operato/i18n'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ScrollbarStyles } from '@operato/styles'\n\n/** Products supply authorized contents and words; the shared dock owns presentation only. */\nexport interface Entity360View {\n /** Canonical subject + read scope, not a display name. Different revisions must have different keys. */\n key: string\n title: string\n context: string\n content: TemplateResult\n styles?: CSSResult[]\n labels: { close: string; expand: string; collapse: string; resize: string; back: string; refresh?: string }\n onClose(): void\n onBack?: () => void\n}\n\n/** Product CSS stays inside this boundary, never changes the dock's layout or controls. */\n@customElement('ox-entity360-content')\nexport class OxEntity360Content extends LitElement {\n @property({ attribute: false }) view?: Entity360View\n @property({ type: Number }) revision = 0\n render() {\n return html`<style>${(this.view?.styles ?? []).map(style => style.cssText).join('\\n')}</style>${keyed(`${this.view?.key}:${this.revision}`, this.view?.content)}`\n }\n}\n\n@customElement('ox-entity360-dock')\nexport class OxEntity360Dock extends LitElement {\n @state() private revision = 0\n static styles = [ScrollbarStyles, css`\n :host { display: block; width: var(--entity360-width, 480px); max-width: 65vw; height: 100%; min-height: 0;\n color: var(--md-sys-color-on-surface, #222); background: var(--md-sys-color-surface, white);\n border-left: 1px solid var(--ui-line, #ccc); box-sizing: border-box; position: relative; }\n :host([expanded]) { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; z-index: 901; }\n aside { height: 100%; display: flex; flex-direction: column; min-height: 0; }\n header { display: flex; align-items: flex-start; gap: 6px; padding: 12px 14px;\n border-bottom: 1px solid var(--ui-line, #ccc); flex: none; }\n .heading { flex: 1; min-width: 0; }\n h2 { font: 600 15px/1.4 var(--ui-font-family, sans-serif); margin: 0; overflow-wrap: anywhere; }\n h2:focus { outline: none; }\n p { font: 12px/1.4 var(--ui-font-family, sans-serif); margin: 4px 0 0; overflow-wrap: anywhere; color: var(--md-sys-color-on-surface-variant, #555); }\n button { font: 14px/1 sans-serif; width: 28px; height: 28px; padding: 0; display: grid; place-items: center;\n flex: none; cursor: pointer; border: none;\n border-radius: 6px; background: transparent; color: inherit; }\n p:empty { display: none; }\n button md-icon { --md-icon-size: 20px; }\n button:hover { background: var(--md-sys-color-surface-container-high, #eee); }\n button:focus-visible, [role=separator]:focus-visible { outline: 2px solid var(--md-sys-color-primary, #2865ad); outline-offset: -2px; }\n .body { overflow: auto; scrollbar-gutter: stable; min-height: 0; flex: 1; overscroll-behavior: contain; }\n .resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; touch-action: none; z-index: 1; }\n :host([expanded]) .resize { display: none; }\n @media (max-width: 900px) {\n :host { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; z-index: 901; }\n .resize, .expand { display: none; }\n }\n @media (pointer: coarse) { button { width: 40px; height: 40px; } }\n `]\n @property({ attribute: false }) view?: Entity360View\n @property({ type: Boolean, reflect: true }) expanded = false\n @state() private width = 480\n private media = matchMedia('(max-width: 900px)')\n @state() private compact = this.media.matches\n private onMedia = () => { this.compact = this.media.matches }\n private dragStart?: { x: number; width: number }\n private onEscape = (event: KeyboardEvent) => {\n // A modal opened above the nonmodal dock owns Escape until it closes.\n if (event.defaultPrevented || history.state?.overlay) return\n if (event.key === 'Escape') this.view?.onClose()\n if (event.key === 'Tab' && (this.expanded || this.compact)) {\n const walk = (root: ParentNode): HTMLElement[] => Array.from(root.querySelectorAll<HTMLElement>('*'))\n .flatMap(el => [el, ...(el.shadowRoot ? walk(el.shadowRoot) : [])])\n const controls = walk(this.renderRoot).filter(el => el.matches('button,a[href],input,select,textarea,summary,[tabindex]') &&\n el.getAttribute('tabindex') !== '-1' && !el.hasAttribute('disabled') && el.getClientRects().length && getComputedStyle(el).visibility !== 'hidden')\n const first = controls[0], last = controls[controls.length - 1]\n const target = event.composedPath()[0]\n if (!controls.includes(target as HTMLElement) || (event.shiftKey ? target === first : target === last)) {\n event.preventDefault()\n ;(event.shiftKey ? last : first)?.focus()\n }\n }\n }\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('keydown', this.onEscape)\n this.media.addEventListener('change', this.onMedia)\n }\n disconnectedCallback() {\n document.removeEventListener('keydown', this.onEscape)\n this.media.removeEventListener('change', this.onMedia)\n super.disconnectedCallback()\n }\n firstUpdated() { this.focusHeading() }\n updated(changes: Map<PropertyKey, unknown>) {\n const previous = changes.get('view') as Entity360View | undefined\n if (changes.has('view') && previous?.key !== this.view?.key) {\n this.renderRoot.querySelector('.body')?.scrollTo(0, 0)\n }\n }\n focusHeading() { this.renderRoot.querySelector<HTMLElement>('h2')?.focus({ preventScroll: true }) }\n private resize(width: number) {\n this.width = Math.max(320, Math.min(width, innerWidth * .65, 960))\n this.style.setProperty('--entity360-width', `${this.width}px`)\n }\n render() {\n const view = this.view\n if (!view) return html``\n const fullscreen = this.expanded || this.compact\n return html`<aside role=${fullscreen ? 'dialog' : 'complementary'} aria-modal=${ifDefined(fullscreen ? 'true' : undefined)} aria-labelledby=\"entity360-title\">\n <div class=\"resize\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n aria-label=${view.labels.resize} aria-valuemin=\"320\" aria-valuemax=${Math.min(innerWidth * .65, 960)} aria-valuenow=${this.width}\n @keydown=${(event: KeyboardEvent) => {\n if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return\n event.preventDefault()\n this.resize(event.key === 'Home' ? 320 : event.key === 'End' ? 960 : this.width + (event.key === 'ArrowLeft' ? 32 : -32))\n }}\n @pointerdown=${(event: PointerEvent) => {\n if (event.button !== 0) return\n this.dragStart = { x: event.clientX, width: this.getBoundingClientRect().width }\n ;(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId)\n }}\n @pointermove=${(event: PointerEvent) => { if (this.dragStart) this.resize(this.dragStart.width + this.dragStart.x - event.clientX) }}\n @pointerup=${() => { this.dragStart = undefined }} @pointercancel=${() => { this.dragStart = undefined }}\n ></div>\n <header>\n ${view.onBack ? html`<button data-action=\"back\" aria-label=${view.labels.back} title=${view.labels.back} @click=${view.onBack}><md-icon aria-hidden=\"true\">arrow_back</md-icon></button>` : ''}\n <div class=\"heading\" aria-live=\"polite\"><h2 id=\"entity360-title\" tabindex=\"-1\">${view.title}</h2><p>${view.context}</p></div>\n <button data-action=\"refresh\" aria-label=${view.labels.refresh ?? i18next.t('button.refresh')}\n title=${view.labels.refresh ?? i18next.t('button.refresh')} @click=${() => { this.revision++; }}><md-icon aria-hidden=\"true\">refresh</md-icon></button>\n <button class=\"expand\" data-action=\"expand\" aria-label=${this.expanded ? view.labels.collapse : view.labels.expand}\n title=${this.expanded ? view.labels.collapse : view.labels.expand} aria-pressed=${this.expanded}\n @click=${() => { this.expanded = !this.expanded }}><md-icon aria-hidden=\"true\">${this.expanded ? 'fullscreen_exit' : 'fullscreen'}</md-icon></button>\n <button data-action=\"close\" aria-label=${view.labels.close} title=${view.labels.close} @click=${view.onClose}><md-icon aria-hidden=\"true\">close</md-icon></button>\n </header>\n <div class=\"body\"><ox-entity360-content .view=${view} .revision=${this.revision}></ox-entity360-content></div>\n </aside>`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-entity360-dock.js","sourceRoot":"","sources":["../../../src/components/ox-entity360-dock.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuC,MAAM,KAAK,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAoBjD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iEAC1F,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;kBACxG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,iBAAiB,IAAI,CAAC,QAAQ;mBACtF,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAA,CAAC,CAAC,gCAAgC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY;iDAC1F,IAAI,CAAC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,WAAW,IAAI,CAAC,OAAO;;sDAE9D,IAAI;aAC7C,CAAA;IACX,CAAC;;AAlHM,sBAAM,GAAG,CAAC,eAAe,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BpC,CAAC,AA5BW,CA4BX;AAC8B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CAAqB;AACR;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAiB;AAEhB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAkB;AAC5C;IAAhB,KAAK,EAAE;8CAAoB;AAEX;IAAhB,KAAK,EAAE;gDAAqC;AAhDlC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAgI3B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { LitElement, css, html, type CSSResult, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { i18next } from '@operato/i18n'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ScrollbarStyles } from '@operato/styles'\n\n/** Products supply authorized contents and words; the shared dock owns presentation only. */\nexport interface Entity360View {\n /** Canonical subject + read scope, not a display name. Different revisions must have different keys. */\n key: string\n title: string\n context: string\n content: TemplateResult\n styles?: CSSResult[]\n labels: { close: string; expand: string; collapse: string; resize: string; back: string; refresh?: string }\n onClose(): void\n onBack?: () => void\n /**\n * Read the same subject again (ADR-0067 decision 8). The contents stay - what a section is writing stays with it;\n * each section asks its door anew. Without it the refresh button is not drawn.\n */\n onRefresh?: () => void\n}\n\n/**\n * A section tells the dock it holds an entry this browser cannot keep as a draft (ADR-0067 decision 8, ADR-0098\n * decision 5): `detail.unkept` true while so, false once saved, discarded or kept. Only then is leaving asked about.\n */\nexport const ENTITY360_UNKEPT = 'entity360-unkept'\n\n/** Product CSS stays inside this boundary, never changes the dock's layout or controls. */\n@customElement('ox-entity360-content')\nexport class OxEntity360Content extends LitElement {\n @property({ attribute: false }) view?: Entity360View\n render() {\n return html`<style>${(this.view?.styles ?? []).map(style => style.cssText).join('\\n')}</style>${keyed(this.view?.key, this.view?.content)}`\n }\n}\n\n@customElement('ox-entity360-dock')\nexport class OxEntity360Dock extends LitElement {\n /** The sections that hold an entry no draft keeps. */\n private unkeptBy = new Set<EventTarget>()\n private onUnkept = (event: Event) => {\n const section = event.composedPath()[0]\n if ((event as CustomEvent<{ unkept: boolean }>).detail?.unkept) this.unkeptBy.add(section)\n else this.unkeptBy.delete(section)\n }\n /** Whether leaving this subject would lose an entry without a word - a draft keeps all the others. */\n get unkept(): boolean {\n for (const section of this.unkeptBy) if (!(section as Node).isConnected) this.unkeptBy.delete(section)\n return this.unkeptBy.size > 0\n }\n static styles = [ScrollbarStyles, css`\n :host { display: block; width: var(--entity360-width, 480px); max-width: 65vw; height: 100%; min-height: 0;\n color: var(--md-sys-color-on-surface, #222); background: var(--md-sys-color-surface, white);\n border-left: 1px solid var(--ui-line, #ccc); box-sizing: border-box; position: relative; }\n :host([expanded]) { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; z-index: 901; }\n aside { height: 100%; display: flex; flex-direction: column; min-height: 0; }\n header { display: flex; align-items: flex-start; gap: 6px; padding: 12px 14px;\n border-bottom: 1px solid var(--ui-line, #ccc); flex: none; }\n .heading { flex: 1; min-width: 0; }\n h2 { font: 600 15px/1.4 var(--ui-font-family, sans-serif); margin: 0; overflow-wrap: anywhere; }\n h2:focus { outline: none; }\n p { font: 12px/1.4 var(--ui-font-family, sans-serif); margin: 4px 0 0; overflow-wrap: anywhere; color: var(--md-sys-color-on-surface-variant, #555); }\n button { font: 14px/1 sans-serif; width: 28px; height: 28px; padding: 0; display: grid; place-items: center;\n flex: none; cursor: pointer; border: none;\n border-radius: 6px; background: transparent; color: inherit; }\n p:empty { display: none; }\n button md-icon { --md-icon-size: 20px; }\n button:hover { background: var(--md-sys-color-surface-container-high, #eee); }\n button:focus-visible, [role=separator]:focus-visible { outline: 2px solid var(--md-sys-color-primary, #2865ad); outline-offset: -2px; }\n .body { overflow: auto; scrollbar-gutter: stable; min-height: 0; flex: 1; overscroll-behavior: contain; }\n .resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; touch-action: none; z-index: 1; }\n :host([expanded]) .resize { display: none; }\n @media (max-width: 900px) {\n :host { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; z-index: 901; }\n .resize, .expand { display: none; }\n }\n :host([contained]) { position: relative; inset: auto; width: 100%; max-width: none; height: 100%; z-index: auto; }\n @media (pointer: coarse) { button { width: 40px; height: 40px; } }\n `]\n @property({ attribute: false }) view?: Entity360View\n @property({ type: Boolean, reflect: true }) expanded = false\n /** The aside workspace owns layout and keyboard boundaries while a companion is visible. */\n @property({ type: Boolean, reflect: true }) contained = false\n @state() private width = 480\n private media = matchMedia('(max-width: 900px)')\n @state() private compact = this.media.matches\n private onMedia = () => { this.compact = this.media.matches }\n get fullscreen(): boolean { return this.expanded || this.compact }\n private dragStart?: { x: number; width: number }\n private onEscape = (event: KeyboardEvent) => {\n // A modal opened above the nonmodal dock owns Escape until it closes.\n if (this.contained || event.defaultPrevented || history.state?.overlay) return\n if (event.key === 'Escape') this.view?.onClose()\n if (event.key === 'Tab' && (this.expanded || this.compact)) {\n const walk = (root: ParentNode): HTMLElement[] => Array.from(root.querySelectorAll<HTMLElement>('*'))\n .flatMap(el => [el, ...(el.shadowRoot ? walk(el.shadowRoot) : [])])\n const controls = walk(this.renderRoot).filter(el => el.matches('button,a[href],input,select,textarea,summary,[tabindex]') &&\n el.getAttribute('tabindex') !== '-1' && !el.hasAttribute('disabled') && el.getClientRects().length && getComputedStyle(el).visibility !== 'hidden')\n const first = controls[0], last = controls[controls.length - 1]\n const target = event.composedPath()[0]\n if (!controls.includes(target as HTMLElement) || (event.shiftKey ? target === first : target === last)) {\n event.preventDefault()\n ;(event.shiftKey ? last : first)?.focus()\n }\n }\n }\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('keydown', this.onEscape)\n this.media.addEventListener('change', this.onMedia)\n this.addEventListener(ENTITY360_UNKEPT, this.onUnkept)\n }\n disconnectedCallback() {\n document.removeEventListener('keydown', this.onEscape)\n this.media.removeEventListener('change', this.onMedia)\n this.removeEventListener(ENTITY360_UNKEPT, this.onUnkept)\n super.disconnectedCallback()\n }\n firstUpdated() { this.focusHeading() }\n updated(changes: Map<PropertyKey, unknown>) {\n if (changes.has('expanded') || changes.has('compact') || changes.has('view'))\n this.dispatchEvent(new CustomEvent('entity360-presentation', { bubbles: true, composed: true }))\n const previous = changes.get('view') as Entity360View | undefined\n if (changes.has('view') && previous?.key !== this.view?.key) {\n this.renderRoot.querySelector('.body')?.scrollTo(0, 0)\n }\n }\n focusHeading() { this.renderRoot.querySelector<HTMLElement>('h2')?.focus({ preventScroll: true }) }\n private resize(width: number) {\n this.width = Math.max(320, Math.min(width, innerWidth * .65, 960))\n this.style.setProperty('--entity360-width', `${this.width}px`)\n }\n render() {\n const view = this.view\n if (!view) return html``\n const fullscreen = !this.contained && this.fullscreen\n return html`<aside role=${fullscreen ? 'dialog' : 'complementary'} aria-modal=${ifDefined(fullscreen ? 'true' : undefined)} aria-labelledby=\"entity360-title\">\n <div class=\"resize\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n aria-label=${view.labels.resize} aria-valuemin=\"320\" aria-valuemax=${Math.min(innerWidth * .65, 960)} aria-valuenow=${this.width}\n @keydown=${(event: KeyboardEvent) => {\n if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return\n event.preventDefault()\n this.resize(event.key === 'Home' ? 320 : event.key === 'End' ? 960 : this.width + (event.key === 'ArrowLeft' ? 32 : -32))\n }}\n @pointerdown=${(event: PointerEvent) => {\n if (event.button !== 0) return\n this.dragStart = { x: event.clientX, width: this.getBoundingClientRect().width }\n ;(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId)\n }}\n @pointermove=${(event: PointerEvent) => { if (this.dragStart) this.resize(this.dragStart.width + this.dragStart.x - event.clientX) }}\n @pointerup=${() => { this.dragStart = undefined }} @pointercancel=${() => { this.dragStart = undefined }}\n ></div>\n <header>\n ${view.onBack ? html`<button data-action=\"back\" aria-label=${view.labels.back} title=${view.labels.back} @click=${view.onBack}><md-icon aria-hidden=\"true\">arrow_back</md-icon></button>` : ''}\n <div class=\"heading\" aria-live=\"polite\"><h2 id=\"entity360-title\" tabindex=\"-1\">${view.title}</h2><p>${view.context}</p></div>\n ${view.onRefresh ? html`<button data-action=\"refresh\" aria-label=${view.labels.refresh ?? i18next.t('button.refresh')}\n title=${view.labels.refresh ?? i18next.t('button.refresh')} @click=${view.onRefresh}><md-icon aria-hidden=\"true\">refresh</md-icon></button>` : ''}\n <button class=\"expand\" data-action=\"expand\" aria-label=${this.expanded ? view.labels.collapse : view.labels.expand}\n title=${this.expanded ? view.labels.collapse : view.labels.expand} aria-pressed=${this.expanded}\n @click=${() => { this.expanded = !this.expanded }}><md-icon aria-hidden=\"true\">${this.expanded ? 'fullscreen_exit' : 'fullscreen'}</md-icon></button>\n <button data-action=\"close\" aria-label=${view.labels.close} title=${view.labels.close} @click=${view.onClose}><md-icon aria-hidden=\"true\">close</md-icon></button>\n </header>\n <div class=\"body\"><ox-entity360-content .view=${view}></ox-entity360-content></div>\n </aside>`\n }\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import '@material/web/button/filled-button.js';
|
|
2
|
+
import '@material/web/button/text-button.js';
|
|
3
|
+
import '@material/web/icon/icon.js';
|
|
4
|
+
import '@operato/input/ox-input-barcode.js';
|
|
5
|
+
import '@operato/popup/ox-popup-actions.js';
|
|
6
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
7
|
+
import { type IdLensDoor, type IdLensHit, type IdLensOutcome } from '../actions/id-lens.js';
|
|
8
|
+
declare const OxIdLens_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
9
|
+
/**
|
|
10
|
+
* The ID Lens - type or scan an identifier in the band, and its Entity 360 opens (ADR-0133).
|
|
11
|
+
*
|
|
12
|
+
* The product gives the doors (`.doors`, one per kind of identifier it keeps) and what the field says
|
|
13
|
+
* (`placeholder`). Everything about a kind - its name, its rules, who may read it, its states - is the product's;
|
|
14
|
+
* the lens only asks, folds and opens.
|
|
15
|
+
*
|
|
16
|
+
* Input is `ox-input-barcode`: typing, a keyboard scanner, or the camera. Nothing listens to the whole page - a
|
|
17
|
+
* scanner reaches the lens only while its field has focus, so a page's own scan listener never races it.
|
|
18
|
+
*/
|
|
19
|
+
export declare class OxIdLens extends OxIdLens_base {
|
|
20
|
+
static styles: import("lit").CSSResult[];
|
|
21
|
+
/** One door per kind of identifier the product keeps. */
|
|
22
|
+
doors: IdLensDoor[];
|
|
23
|
+
/**
|
|
24
|
+
* What the field says before anything is typed - the product names its own kinds. A function is read at each render,
|
|
25
|
+
* so a band registered once still follows the language.
|
|
26
|
+
*/
|
|
27
|
+
placeholder: string | (() => string);
|
|
28
|
+
private busy;
|
|
29
|
+
private said;
|
|
30
|
+
private field?;
|
|
31
|
+
render(): TemplateResult;
|
|
32
|
+
/**
|
|
33
|
+
* `ox-input-barcode` says `change` on Enter, after a camera scan, and also when the field loses focus with
|
|
34
|
+
* new text. Only the first two are a request to look - leaving the field is not. After Enter or a scan the
|
|
35
|
+
* focus is still in the lens; after a blur it has gone elsewhere.
|
|
36
|
+
*/
|
|
37
|
+
private committed;
|
|
38
|
+
private find;
|
|
39
|
+
private show;
|
|
40
|
+
}
|
|
41
|
+
declare const OxIdLensResults_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
42
|
+
/**
|
|
43
|
+
* What a look-up found when it cannot just open one 360: several hits to choose from, none, or a door that
|
|
44
|
+
* did not answer. The first hit is never picked for the person (ADR-0133 2-2).
|
|
45
|
+
*/
|
|
46
|
+
export declare class OxIdLensResults extends OxIdLensResults_base {
|
|
47
|
+
static styles: import("lit").CSSResult[];
|
|
48
|
+
outcome?: IdLensOutcome;
|
|
49
|
+
doors: IdLensDoor[];
|
|
50
|
+
onPick?: (hit: IdLensHit) => void;
|
|
51
|
+
onRetry?: () => void;
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
render(): TemplateResult;
|
|
54
|
+
/** The product's word for a kind; the kind name itself only when no door names it. */
|
|
55
|
+
private kindText;
|
|
56
|
+
private hit;
|
|
57
|
+
}
|
|
58
|
+
export {};
|