@mojawork/ui-docs 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/catalog/atoms/image-grid.md +45 -1
- package/catalog/atoms/inline-spinner.md +188 -0
- package/catalog/atoms/mosaic.md +1 -1
- package/catalog/atoms/reader-doc.md +25 -0
- package/catalog/forms/chip.md +285 -0
- package/catalog/guide.json +69 -7
- package/catalog/layout/spinner.md +7 -0
- package/catalog/manifest.json +29 -5
- package/catalog/version.json +2 -2
- package/package.json +1 -1
- package/storybook/2621.2245d387.iframe.bundle.js +1 -0
- package/storybook/4555.525bbef9.iframe.bundle.js +1 -0
- package/storybook/9045.46ed3f61.iframe.bundle.js +2 -0
- package/storybook/{_external-mwork-music-player-docs-mdx.6f943768.iframe.bundle.js → _external-mwork-music-player-docs-mdx.3d0f7156.iframe.bundle.js} +1 -1
- package/storybook/_external-mwork-music-player-mwork-music-player-stories.26c06b83.iframe.bundle.js +1 -0
- package/storybook/atoms-_electrons-loader-docs-mdx.1176957f.iframe.bundle.js +1 -0
- package/storybook/atoms-_electrons-loader-loader-component-stories.8edadc42.iframe.bundle.js +1 -0
- package/storybook/atoms-image-grid-docs-mdx.7cb6414e.iframe.bundle.js +1 -0
- package/storybook/atoms-image-grid-image-grid-component-stories.8290e900.iframe.bundle.js +1 -0
- package/storybook/atoms-inline-spinner-docs-mdx.a98163b8.iframe.bundle.js +1 -0
- package/storybook/atoms-inline-spinner-inline-spinner-component-stories.76f59aa8.iframe.bundle.js +1 -0
- package/storybook/{atoms-mosaic-mosaic-component-stories.0a6bc043.iframe.bundle.js → atoms-mosaic-mosaic-component-stories.c2ec95f2.iframe.bundle.js} +1 -1
- package/storybook/atoms-reader-doc-docs-mdx.1860338f.iframe.bundle.js +1 -0
- package/storybook/atoms-reader-doc-reader-doc-component-stories.8ccd618b.iframe.bundle.js +1 -0
- package/storybook/{atoms-thumb-docs-mdx.2143ad01.iframe.bundle.js → atoms-thumb-docs-mdx.7286b617.iframe.bundle.js} +1 -1
- package/storybook/{atoms-thumb-thumb-component-stories.06f51d03.iframe.bundle.js → atoms-thumb-thumb-component-stories.f7e9dbae.iframe.bundle.js} +1 -1
- package/storybook/{atoms-typewriter-docs-mdx.3b1088c0.iframe.bundle.js → atoms-typewriter-docs-mdx.993bc264.iframe.bundle.js} +1 -1
- package/storybook/atoms-typewriter-typewriter-component-stories.80f07c89.iframe.bundle.js +1 -0
- package/storybook/examples-image-grid-slider-docs-mdx.d3578699.iframe.bundle.js +1 -0
- package/storybook/examples-image-grid-slider-image-grid-slider-stories.cda91b79.iframe.bundle.js +1 -0
- package/storybook/forms-chip-chip-component-stories.90a45ea4.iframe.bundle.js +1 -0
- package/storybook/forms-chip-docs-mdx.01e1b518.iframe.bundle.js +1 -0
- package/storybook/{home-overview-mdx.0d4ede52.iframe.bundle.js → home-overview-mdx.a2833e60.iframe.bundle.js} +1 -1
- package/storybook/iframe.html +3 -3
- package/storybook/index.json +1 -1
- package/storybook/layout-spinner-docs-mdx.03741741.iframe.bundle.js +1 -0
- package/storybook/layout-spinner-spinner-component-stories.69ae1389.iframe.bundle.js +1 -0
- package/storybook/{main.e33bfc7e33aad318b1d2.css → main.4530991c57c404682bbb.css} +16 -0
- package/storybook/main.5e4e255f.iframe.bundle.js +1 -0
- package/storybook/project.json +1 -1
- package/storybook/runtime~main.a2ec52c2.iframe.bundle.js +1 -0
- package/storybook/version.json +2 -2
- package/version.json +2 -2
- package/storybook/4555.251b232c.iframe.bundle.js +0 -1
- package/storybook/9045.a50616e9.iframe.bundle.js +0 -2
- package/storybook/_external-mwork-music-player-mwork-music-player-stories.08fbf651.iframe.bundle.js +0 -1
- package/storybook/atoms-image-grid-docs-mdx.18b4df2a.iframe.bundle.js +0 -1
- package/storybook/atoms-image-grid-image-grid-component-stories.a0a92d9e.iframe.bundle.js +0 -1
- package/storybook/atoms-reader-doc-docs-mdx.0688c3b9.iframe.bundle.js +0 -1
- package/storybook/atoms-reader-doc-reader-doc-component-stories.a6fec57d.iframe.bundle.js +0 -1
- package/storybook/atoms-typewriter-typewriter-component-stories.4fefc019.iframe.bundle.js +0 -1
- package/storybook/examples-image-grid-slider-docs-mdx.9e38157e.iframe.bundle.js +0 -1
- package/storybook/examples-image-grid-slider-image-grid-slider-stories.028c8c2b.iframe.bundle.js +0 -1
- package/storybook/layout-spinner-docs-mdx.4be572c0.iframe.bundle.js +0 -1
- package/storybook/layout-spinner-spinner-component-stories.ab8245c6.iframe.bundle.js +0 -1
- package/storybook/main.1f12809e.iframe.bundle.js +0 -1
- package/storybook/runtime~main.52ba2f02.iframe.bundle.js +0 -1
- /package/storybook/{9045.a50616e9.iframe.bundle.js.LICENSE.txt → 9045.46ed3f61.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3146],{"./libs/ui/.storybook/blocks/guide.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Ay:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_guide_entries__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/blocks/guide.entries.js"),_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.model.mjs");const Link=({href,children})=>href?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.zE,{href,children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children}),Sentences=({items})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul",{children:items.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li",{children:s},i))}),Block=({of,entry})=>{const m=(0,_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__.Cc)(entry,_guide_entries__WEBPACK_IMPORTED_MODULE_4__.H,of);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section",{className:"ui-guide",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("h4",{children:["Guide — a recommendation, not the truth",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[" · reviewed ",m.reviewed]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:["Written by an agent from the sources below, only for what runs in the house."," ","component"===m.kind?"The section above is what the component does; this is what to reach for it for.":"The pages of the parts say what each does; this is what they are for together."," ","Where the two disagree, the page wins."]}),m.uses.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Builds on"})," ",m.uses.map((u,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:u.href,children:u.selector})]},u.selector))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Use it for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.useFor}),m.notFor.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Not for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.notFor})]}),m.instead.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Instead"})," ",m.instead.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.selector})]},s.selector))]}),m.note&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Note"})," ",m.note]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Shown in"})," ",m.shownIn.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&" · ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.label})]},s.label))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Sources"})," ",m.sources.join(" · ")]})})]})};function _createMdxContent(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:["\n","\n","\n","\n","\n","\n","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Block,{of:props.of,entry:props.entry})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/atoms/image-grid/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_image_grid_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_image_grid_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-image-grid.json");function _createMdxContent(props){const _components={a:"a",code:"code",em:"em",h3:"h3",h4:"h4",h5:"h5",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_image_grid_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"atoms-image-grid",children:"Atoms: Image Grid"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiImageGridComponent"})," is a versatile and responsive grid-based image display component. It allows for dynamic configuration of columns, gaps, and heights, making it suitable for galleries, portfolios, or any grouped image presentation."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"what-it-does-and-what-it-does-not",children:"What it does, and what it does not"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Lays pictures out in a fixed number of columns, with a gap, a height and an\noptional overlay per tile, and reports which tile is selected or clicked. It\nshares an index with ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-image-slider"})," (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"setIndex"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"currentIndex"}),") so grid and\nslider can point at the same picture. It opens nothing itself: a click emits\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"clickIndex"}),", and what follows — a slider in zoom, a route — is the host's\ndecision. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," must be set; the default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"0"})," draws no columns."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"ui-image-grid",entry:_guide_ui_image_grid_json__WEBPACK_IMPORTED_MODULE_6__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"image-grid",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/atoms-image-grid--image-grid",children:"Image Grid"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"features",children:"Features"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Responsive Grid"}),": Automatically adjusts to its container and supports configurable column counts."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Lazy Loading Support"}),": Integrated ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded"})," state to manage image rendering."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Interactive Overlays"}),": Supports different overlay types (e.g., 'default', 'doors') for enhanced user interaction."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Click Area"}),": An ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<ng-template uiImageGridClickArea>"})," projected into the tag is stamped into every tile as the active tile's overlay — with the tile's item and index as context."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Action Mode"}),": Enable interactive selection with event emitting for current and clicked indices."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Dynamic Styling"}),": Configure gap, height, and image scaling per item."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"inputs",children:"Inputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"@Input"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"data"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"UiImageDisplayItemDataType[] | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Array of image objects containing source, alt text, and scaling info."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"cols"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Number of columns in the grid. The default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"0"})," renders no columns — always set it."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"gap"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Gap between grid items in pixels."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"height"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"undefined"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Height of the grid container. If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"singleRow"})," is false, this is the total height. If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"singleRow"})," is true, this value is divided by ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"cols"})," to determine the row height. Falls back to 200px when no height is given."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"singleRow"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["If true, the grid renders as a single row with horizontal scrolling. The row height is calculated as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"height / cols"}),"."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"setIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Programmatically set the active/scrolled-to image index."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"action"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Enables click interactions and active state highlighting."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"loaded"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Flag to trigger image rendering (useful for deferred loading). While it is false, every tile shows its title instead of its picture — the same branch a tile without a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"src"}),' falls into, see "A tile without a picture".']})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"overlayType"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'default' | 'doors'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'default'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Visual style of the hover/active overlay."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"debug"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Shows internal state information (cols, indices, src) for debugging."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"a-tile-without-a-picture",children:"A tile without a picture"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["A tile without a source draws ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"no image at all"}),": it shows an icon with the\nitem's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"})," underneath, gets the modifier class ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"._-no-image"}),", and is left\nout of the click area. Nothing is broken — this is what the component does\nwhen it has nothing to show."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["In the story above, the fourth tile is that case, and it says so: the entry\ncarries the title ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:'"no image on purpose"'}),". Give it whatever wording fits your\ncase — the component supplies the space, never the words."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Two things worth knowing about that state:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["It is the same branch as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded: false"}),"."]})," Turn ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded"})," off and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"every"}),'\ntile shows its title. The component does not distinguish "not there yet" from\n"not there at all" — both mean "no picture to draw", and both look the same.']}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"The grid pads to a square."})," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"gridColsInternal"})," squares the column count,\nso a data set that does not fill the last row leaves empty tiles behind. With\nthe story's 25 items that is 49 tiles: 24 of them carry no data and render as\nthe same empty state."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"grid-logic",children:"Grid Logic"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The component uses internal computed signals to determine the grid layout and height."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.h5,{id:"column-calculation-gridcolsinternal",children:["Column Calculation (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"gridColsInternal"}),")"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The number of columns is determined by the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," input and the total number of items (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"dataCount"}),"):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"dataCount / cols > cols"}),', the grid becomes "square-ish" or expands to fit items, calculating columns as ',(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"Math.ceil(dataCount / cols)"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["Otherwise, it uses the fixed ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," value provided."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["With ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," at ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"0"})," (the default) no expansion happens and the grid gets zero columns — a column count is part of using the component."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.h5,{id:"height-calculation-scrollerheight",children:["Height Calculation (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"scrollerHeight"}),")"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The height of the grid container is dynamically calculated:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["Standard Mode (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," is false)"]}),": Uses the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"})," input value in pixels. Falls back to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"200px"})," when no ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"})," is given."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["Single Row Mode (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," is true)"]}),": The height is calculated as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height / cols"})," (both must be set; otherwise the same ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"}),"-or-",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"200px"})," fallback applies). This ensures that even in a horizontal scroll scenario, the items maintain a consistent aspect ratio based on the intended column count."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"outputs",children:"Outputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"@Output"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"currentIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when a new item becomes active or is clicked."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"clickIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when an already active item is clicked (only when a click-area template is projected)."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"the-click-area",children:"The click area"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The overlay that appears on the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"active"})," tile, and whose second click\nemits ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"clickIndex"}),". It is an ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<ng-template uiImageGridClickArea>"})," projected\ninto the tag: the grid stamps it into every tile, so everything Angular can\ndo inside a template works here — bindings, pipes, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"(click)"})," handlers — and\nthe template is handed the tile's item (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"let-item"}),") and index\n(",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:'let-index="index"'}),")."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A template rather than projected content, because content can be projected\nonce and the grid needs the area in every tile. It used to clone a projected\nelement's innerHTML per tile, which ran the markup through the sanitizer and\nleft a dead copy without events; a stamped template keeps all of that alive."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The marker is the directive ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiImageGridClickAreaDirective"})," — import it next\nto the grid. It is a marker and nothing else, so the grid finds the click\narea by name rather than taking the first template it meets; a caller may\nproject other templates (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"*ngIf"}),", a structural directive of their own)\nwithout one of those ending up in every tile."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-grid [data]="myData" [action]="true" (clickIndex)="open($event)">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="my-overlay">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n</ui-image-grid>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"sizing",children:"Sizing"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The host fills its container (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"100%"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"100%"}),") by default. Give it a fixed size\nwithout a cascade fight through the named hooks ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"--ui-image-grid-width"})," and\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"--ui-image-grid-height"}),"."]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[8039],{"./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiImageGridClickAreaDirective});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs");let UiImageGridClickAreaDirective=class UiImageGridClickAreaDirective{template=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.C4Q);static ngTemplateContextGuard(_directive,_context){return!0}};UiImageGridClickAreaDirective=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.WLR)({selector:"ng-template[uiImageGridClickArea]"})],UiImageGridClickAreaDirective)},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{p:()=>UiImageGridComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var image_grid_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"),image_grid_componentngResource_default=__webpack_require__.n(image_grid_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),resize_signal=__webpack_require__("./libs/ui/src/lib/helpers/resize-signal.ts"),image_grid_click_area_directive=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts");let UiImageGridComponent=class UiImageGridComponent{get scrollerHeightValue(){return this.scrollerHeight()}scroller;imageContainer;clickArea=(0,core.contentChild)(image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q});resizeEvent=(0,resize_signal.H)();data=(0,core.input)(null);dataCount=(0,_resource_chunk.EW)(()=>this.data()?.length??0);dataCountItems=(0,_effect_chunk2.vPA)([0]);debug=(0,core.input)(!1);singleRow=(0,core.input)(!1);gap=(0,core.input)(0);overlayType=(0,core.input)("default");overlayTypeClass=(0,_resource_chunk.EW)(()=>`_-${this.overlayType()}`);cols=(0,core.input)(0);height=(0,core.input)();action=(0,core.input)(!1);loaded=(0,core.input)(!1);setIndex=(0,core.input)(0);currentIndex=(0,core.output)();clickIndex=(0,core.output)();scrollerHeight=(0,_resource_chunk.EW)(()=>{const height=this.height(),cols=this.cols();return this.singleRow()&&height&&cols?height/cols+"px":height?`${height}px`:"200px"});gridColsInternal=(0,_resource_chunk.EW)(()=>{const counter=this.cols();return 0!==counter&&this.dataCount()/counter>counter?Math.ceil(this.dataCount()/counter):counter});active=(0,_effect_chunk2.vPA)(null);hideDisplay=(0,_effect_chunk2.vPA)(!0);clickAreaExist=(0,_resource_chunk.EW)(()=>void 0!==this.clickArea());constructor(){(0,_effect_chunk2.QZP)(()=>{this.gap(),this.height(),this.cols(),this.resizeEvent(),this.updateGrid()}),(0,_effect_chunk2.QZP)(()=>{this.setIndex(),this.scrollToChild(this.setIndex()),this.active.set(this.setIndex())}),(0,_effect_chunk2.QZP)(()=>{this.action(),this.active.set(null)})}ngAfterViewInit(){this.active.set(this.setIndex()),this.updateGrid(),this.fader()}clickAreaContext(index){const item=this.data()?.[index];return item?{$implicit:item,index}:null}updateGrid(){const scroller=this.scroller?.nativeElement;scroller&&(scroller.style.height=this.scrollerHeight());const element=this.imageContainer?.nativeElement;if(element&&this.dataCount()){const gap=this.gap();this.dataCountItems.set(Array.from({length:this.gridColsInternal()*this.gridColsInternal()},(_,index)=>index+1));const repeatCount=this.singleRow()?this.dataCount():this.gridColsInternal();setTimeout(()=>{element.style.display="grid",element.style.gap=`${gap}px`,element.style.gridTemplateColumns=`repeat(${repeatCount}, 1fr)`,this.applyStylesToChildren()},100)}}calculateGridSize(containerSize){const adjustedSize=containerSize/this.cols()-this.gap();return Math.ceil(adjustedSize)}applyStylesToChildren(){const element=this.imageContainer?.nativeElement;if(element){const width=this.calculateGridSize(element.offsetWidth??0),height=this.singleRow()?element.offsetHeight:this.calculateGridSize(element.offsetHeight??0),applyChildStyles=child=>{child.style.height=`${height}px`,child.style.width=`${width}px`};element.childNodes.forEach(child=>{child instanceof HTMLElement&&applyChildStyles(child)})}}fader(){this.hideDisplay.set(!0),setTimeout(()=>{this.hideDisplay.set(!1)},800)}scrollToChild(index){const containerElement=this.imageContainer?.nativeElement;if(!containerElement)return;const targetChild=containerElement.childNodes[index];if(!(targetChild instanceof HTMLElement))return;const scrollOffset=this.calculateScrollOffset(containerElement,targetChild);this.scroller?.nativeElement.scrollTo({left:scrollOffset,top:0})}calculateScrollOffset(container,child){return child.offsetLeft-container.offsetWidth/2+child.offsetWidth/2}useAction(index){this.action()&&this.imageSrc(index)&&(this.clickAreaExist()&&this.active()===index&&this.clickIndex.emit(index),this.currentIndex.emit(index),this.active.set(index),this.scrollToChild(index))}scale(index){const value=this.data()?.[index]?.src.scale;return`transform: scale(${value??1})`}imageSrc(index){return this.data()?.[index]?.src.default}imageAlt(index){return this.data()?.[index]?.alt}imageTitle(index){return this.data()?.[index]?.title}static ctorParameters=()=>[];static propDecorators={scrollerHeightValue:[{type:_debug_node_chunk.g$6,args:["style.height"]}],scroller:[{type:core.ViewChild,args:["scroller"]}],imageContainer:[{type:core.ViewChild,args:["imageContainer"]}],clickArea:[{type:core.ContentChild,args:[image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q,isSignal:!0}]}],data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}],debug:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"debug",required:!1,transform:void 0}]}],singleRow:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"singleRow",required:!1,transform:void 0}]}],gap:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"gap",required:!1,transform:void 0}]}],overlayType:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"overlayType",required:!1,transform:void 0}]}],cols:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"cols",required:!1,transform:void 0}]}],height:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"height",required:!1,transform:void 0}]}],action:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"action",required:!1,transform:void 0}]}],loaded:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"loaded",required:!1,transform:void 0}]}],setIndex:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"setIndex",required:!1,transform:void 0}]}],currentIndex:[{type:_debug_node_chunk.k7i,args:["currentIndex"]}],clickIndex:[{type:_debug_node_chunk.k7i,args:["clickIndex"]}]}};UiImageGridComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-image-grid",template:'@if (data()) {\n <div class="_scroller" #scroller>\n <div\n #imageContainer\n class="_image-container"\n [class._-hide-display]="hideDisplay()"\n >\n @for (item of dataCountItems(); track item; let i = $index) {\n <button\n class="_wrapper"\n [class._-action]="action() && imageSrc(i)"\n [class._-active]="active() === i"\n [class._-no-image]="!imageSrc(i)"\n [class]="overlayTypeClass()"\n (click)="useAction(i)"\n >\n @if (debug()) {\n dataCount: {{ this.dataCount() }} <br />\n internalCounter: {{ this.gridColsInternal() }} <br />\n counter: {{ this.cols() }} <br />\n src: {{ imageSrc(i) }}\n } @else {\n @if (imageSrc(i) && loaded()) {\n <figure>\n <img\n [style]="scale(i)"\n [src]="imageSrc(i)"\n [alt]="imageAlt(i)"\n [title]="imageTitle(i)"\n />\n </figure>\n @if (clickArea(); as template) {\n <div class="_click-area">\n <ng-container\n *ngTemplateOutlet="template; context: clickAreaContext(i)"\n ></ng-container>\n </div>\n }\n } @else {\n \x3c!-- No picture: the same shape the image editor uses — icon\n centred, whatever title the item carries underneath. No\n stand-in text: an empty title is the caller\'s business. --\x3e\n <div class="_empty">\n <span class="ui-icon x3" aria-hidden="true">image</span>\n <strong>{{ imageTitle(i) }}</strong>\n </div>\n }\n }\n </button>\n }\n </div>\n </div>\n}\n',imports:[_common_module_chunk.T3],styles:[image_grid_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiImageGridComponent)},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ImageGrid:()=>ImageGrid,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_forms__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/forms/fesm2022/forms.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),_image_mock__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./libs/ui/src/lib/atoms/image.mock.ts"),_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"),_image_grid_component__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Atoms/Image Grid",component:_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({providers:[_angular_forms__WEBPACK_IMPORTED_MODULE_0__.vS],imports:[_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__.b,_angular_forms__WEBPACK_IMPORTED_MODULE_0__.YN,_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__.u]})],argTypes:{cols:{control:{type:"range",min:1,max:16,step:1}},gap:{control:{type:"range",min:0,max:64,step:1}},height:{control:{type:"range",min:100,max:1e3,step:10}},setIndex:{control:{type:"range",min:0,max:24,step:1}},action:{control:"boolean"},loaded:{control:"boolean"},singleRow:{control:"boolean"},overlayType:{control:"select",options:["default","doors"]},currentIndex:{table:{disable:!0}},clickIndex:{table:{disable:!0}},data:{control:"object"}},parameters:{docs:{canvas:{sourceState:"none"},source:{code:null}}},args:{cols:4,gap:4,height:520,setIndex:0,action:!0,loaded:!0,singleRow:!1,overlayType:"default",data:(0,_image_mock__WEBPACK_IMPORTED_MODULE_3__.W)()}},ImageGrid={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n '})},__namedExportsOrder=["ImageGrid"];ImageGrid.parameters={...ImageGrid.parameters,docs:{...ImageGrid.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n `\n };\n }\n}',...ImageGrid.parameters?.docs?.source}}}},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n z-index: 0;\n --wrapper-height: 60rem;\n --button-size: 4rem;\n display: flex;\n /* Fills its container by default; the named hooks let a consumer set a fixed\n size without a cascade fight (tickets#241, tickets#251). */\n width: var(--ui-image-grid-width, 100%);\n height: var(--ui-image-grid-height, 100%);\n border-radius: calc(var(--ui-border-width) * 4);\n\n ._scroller {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n overflow-x: scroll;\n background-color: var(--ui-c-background);\n scroll-behavior: smooth;\n }\n\n ._image-container {\n position: absolute;\n top: 0;\n left: 0;\n display: grid;\n width: 100%;\n height: 100%;\n transition: opacity calc(var(--ui-time) * 0.1) linear;\n\n &._-hide-display {\n opacity: 0;\n }\n\n button._wrapper {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n gap: calc(var(--ui-spacer) * 0.5);\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: scale calc(var(--ui-time) * 0.5) ease-in-out;\n background-color: var(--ui-c-fourthly);\n border: 0;\n\n &._-no-image {\n cursor: default;\n opacity: 0.5;\n }\n\n /* The empty state, same arrangement as the image editor's: icon above,\n title below, both dimmed. */\n ._empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: calc(var(--ui-spacer) * 0.25);\n }\n\n &._-default {\n &:not(._-action) {\n cursor: default;\n }\n\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n }\n\n &._-doors {\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &::after,\n &::before {\n z-index: 1;\n content: '\\00a0';\n position: absolute;\n left: 0;\n display: flex;\n height: 100%;\n width: 100%;\n background-color: var(--ui-c-background);\n transition: var(--ui-time) ease-in-out;\n opacity: 0.6;\n }\n\n &::before {\n top: -50%;\n z-index: 1;\n }\n\n &::after {\n top: 50%;\n }\n\n &._-active::before {\n opacity: 0;\n top: -100%;\n }\n\n &._-active::after {\n opacity: 0;\n top: 100%;\n }\n }\n\n figure {\n position: relative;\n display: flex;\n flex-flow: column;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n img {\n width: auto;\n max-width: initial;\n aspect-ratio: auto;\n transition: transform calc(var(--ui-time) * 0.5) ease-in-out;\n -webkit-user-select: none;\n user-select: none;\n }\n }\n\n ._click-area {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: var(--ui-time) ease-in-out;\n }\n\n &._-active {\n ._click-area {\n opacity: 1;\n }\n }\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3550],{"./libs/ui/.storybook/blocks/guide.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Ay:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_guide_entries__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/blocks/guide.entries.js"),_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.model.mjs");const Link=({href,children})=>href?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.zE,{href,children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children}),Sentences=({items})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul",{children:items.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li",{children:s},i))}),Block=({of,entry})=>{const m=(0,_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__.Cc)(entry,_guide_entries__WEBPACK_IMPORTED_MODULE_4__.H,of);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section",{className:"ui-guide",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("h4",{children:["Guide — a recommendation, not the truth",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[" · reviewed ",m.reviewed]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:["Written by an agent from the sources below, only for what runs in the house."," ","component"===m.kind?"The section above is what the component does; this is what to reach for it for.":"The pages of the parts say what each does; this is what they are for together."," ","Where the two disagree, the page wins."]}),m.uses.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Builds on"})," ",m.uses.map((u,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:u.href,children:u.selector})]},u.selector))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Use it for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.useFor}),m.notFor.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Not for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.notFor})]}),m.instead.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Instead"})," ",m.instead.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.selector})]},s.selector))]}),m.note&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Note"})," ",m.note]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Shown in"})," ",m.shownIn.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&" · ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.label})]},s.label))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Sources"})," ",m.sources.join(" · ")]})})]})};function _createMdxContent(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:["\n","\n","\n","\n","\n","\n","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Block,{of:props.of,entry:props.entry})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/atoms/reader-doc/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/reader-doc/reader-doc.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_reader_doc_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-reader-doc.json");function _createMdxContent(props){const _components={code:"code",em:"em",h3:"h3",hr:"hr",p:"p",strong:"strong",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"readerdoc",children:"ReaderDoc"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Reads a Markdown document in the house design."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"what-it-does-and-what-it-does-not",children:"What it does, and what it does not"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["It takes Markdown as a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"string"}),". No ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"HttpClient"}),", no route, no cache, no\nlanguage switching, no publication list — everything that knows ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"where"})," a text\ncame from, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"which"})," language it should appear in and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"whether"})," there is a file\nto take away stands in front of it."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"That is what lets the same component serve a public site, this Storybook page\nand a customer instance without any of them leaking into the others. On this\npage it runs with no network at all."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.Default}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"ui-reader-doc",entry:_guide_ui_reader_doc_json__WEBPACK_IMPORTED_MODULE_6__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"raw-html-is-discarded-not-sanitised",children:"Raw HTML is discarded, not sanitised"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Markdown allows embedded HTML, and that is the only way foreign markup could\nreach the page. The renderer closes it without any dependency: an HTML token\nproduces nothing, so afterwards the output can only consist of the tags the\nMarkdown parser builds itself. What is left to check is exactly one thing —\nthe values of ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"href"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"src"}),". Three schemes pass — ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"http:"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"https:"})," and\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"mailto:"})," — and so does every relative address, an anchor included. Everything\nelse is refused, counted and named like a dropped tag. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"urlAllowed"})," carries a\nspec of its own listing both sides, so this paragraph cannot drift away from\nthe code."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["This is a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"tighter"})," boundary than a sanitiser, not a cheaper one. A sanitiser\npermits a lot and forbids the known-bad; this renderer cannot produce anything\nforeign in the first place. It is a design decision as much as a safety one: a\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<div align>"})," or an inline ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"style"})," out of a README would break the house design\nopen from the inside."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The words between the tags survive — they are separate tokens, so a sentence\nkeeps its text and loses only its markup."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"And nothing disappears quietly."})," What was dropped is counted, named and\nstated on the page. There is no input that hides it: the notice appears only\nwhen content really was left out, so a switch against it would be flipped in\nexactly the moment it is needed. Whoever writes Markdown without HTML never\nsees it."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.DroppedMarkup}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"A trap worth knowing:"})," HTML comments are raw-HTML tokens too.\nA house convention such as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"\x3c!-- break --\x3e"})," is a\nconvention, not discarded content, and is never counted — otherwise every\ndocument in the house would report a finding and the state would be noise\nnobody reads."]})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"sections",children:"Sections"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Every second-level heading starts a section, and every section stands open.\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Nothing in a document opens or closes."})," A reader came to read, and a text\nthat has to be unpacked first is a text that is half missing — so there is no\nfold, no summary and no second, shorter version to switch to. What the\ncomponent offers instead are ways ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"out"})," of the document: a finished file and a\nsheet of paper."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The title is a real ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"h2"})," carrying the section's anchor, so the document keeps\nan outline for anyone navigating by headings."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"the-text-keeps-its-own-voice",children:"The text keeps its own voice"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The document area brings ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"no design of its own"}),". Headings are told apart by\nsize and air, links are underlined, code blocks, tables and quotes take the\nlibrary's tokens and nothing else. There is no house gesture stamped onto the\ntext."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"That is not modesty, it is the job: this component carries a foreign document —\na README, a licence, a text somebody else wrote — and a reader that decorates\nwhat it displays makes every source look like it was written here. The\nsurroundings are the library's; the text is the author's."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"One position the reader does decide, because Markdown cannot: a paragraph\nthat holds nothing but an image — linked or not — is a figure and stands\ncentred. An image inside prose keeps its place in the line. No frame, no\ncaption, nothing else."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.Figure}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["And one thing it keeps whole: inline code never wraps. An identifier, a file\nname, a flag is one token, and a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"change-me"})," split at its hyphen across two\nlines of a narrow table cell is no longer the thing it names. The line around\nthe token breaks; the token does not. A code block is unaffected — ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"pre"}),"\nkeeps its own line breaks and scrolls sideways. In the same picture: table\ncells read from their first line — a one-word key starts level with the\ndescription beside it, not halfway down it."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.CodeInNarrowCell}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"And it holds that in both directions: the component leaves no hooks in its\noutput for an outside stylesheet to hang a design on. What it renders is\nheadings, paragraphs, lists, links, tables — the tags themselves, with nothing\nwrapped around them. Whatever this reader looks like, it decides here, in its\nown file."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"anchors-what-survives-and-what-does-not",children:"Anchors: what survives and what does not"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The renderer gives every heading a slug, and the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"section"})," carries it into\nthe DOM from the template — so a section is a link target."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["A heading ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"inside"})," the injected HTML is not. Angular's sanitiser runs over\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"[innerHTML]"})," as a second net and strips ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"id"})," on the way. That net is kept\ndeliberately rather than bypassed: the safety here already comes from the\nrenderer, and a second one costs nothing but those ids. The behaviour is\npinned by a test, so it cannot change unnoticed."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"two-language-states-and-they-must-never-be-confused",children:"Two language states, and they must never be confused"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"State"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"When"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"How it looks"})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tbody",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"none"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"view language = content language"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"nothing"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"source-language"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["they differ, and that is ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("em",{children:"expected"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"a quiet note above the document"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"fallback"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"the requested language is missing although it should exist"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"defect"}),": error colour, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'role="alert"'})]})]})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The component shows the state; it does not decide it. Only the placer knows\nwhether a document ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"ought to have been"})," published in both languages. A fallback\nthat reads like an offer is how an English page ends up in a German view\nunremarked."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.SourceLanguage}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.FallbackDefect}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"the-ways-out",children:"The ways out"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A button appears only when it can keep its promise: no address, no download\nbutton. The file itself is handed in — the component makes nothing and knows\nnothing about how it came to be."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Printing is the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"side way"}),": the chrome disappears and the page breaks are\nkept off headings and out of list items — that is all the component does for\npaper, and deliberately so. A full paper design is somebody else's job; this\none shows a document on a screen and gets out of the way when the sheet\ncomes."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Both ways out are icon buttons in the library's own shape, with their wording\nin ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"})," so it stays translated."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:'The date in the footer is handed in as text. The component never asks the\nclock: a document is as current as the release that shipped it, and a component\nstamping "today" onto it would be making that up.'}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.WaysOut}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"the-loud-states",children:"The loud states"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Nothing to read is a state, not an absence. An empty area looks like a\ncomponent that failed to render, and a reader cannot tell the difference."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.Empty}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A failure the placer wants shown appears in its own words, in place of the\ndocument."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_reader_doc_component_stories__WEBPACK_IMPORTED_MODULE_4__.Failed}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"properties",children:"Properties"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Name"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tbody",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"markdown"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The document. Empty or missing ends in the loud empty state, never in a\nblank page."})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"error"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["A failure to show ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("em",{children:"instead of"})," the document, in the placer's own\nwords — only they can say it in a way that fits the site."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"notice"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"UiReaderNotice"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'none'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'source-language'"})," or ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'fallback'"})," — see the two\nlanguage states above. The component shows the state; it does not\ndecide it."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"contentLang"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["The language the text is in, for the notice — a label such as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"EN"}),"."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"stand"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The house stamp, pre-formatted. Text, because the component never asks\nthe clock."})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"downloadHref"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Where the ready-made file lies. No address, no button — the component\nmakes no file and knows nothing about how one came to be."})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"downloadName"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The name the file is saved under."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"printable"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"boolean"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"false"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Whether the print button is drawn. It is not a lock on the method:\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"print()"})," is public, so a host can put the control wherever\nit belongs and leave this off."]})})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3999],{"./libs/ui/src/lib/atoms/reader-doc/reader-doc.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CodeInNarrowCell:()=>CodeInNarrowCell,Default:()=>Default,DroppedMarkup:()=>DroppedMarkup,Empty:()=>Empty,Failed:()=>Failed,FallbackDefect:()=>FallbackDefect,Figure:()=>Figure,SourceLanguage:()=>SourceLanguage,WaysOut:()=>WaysOut,__namedExportsOrder:()=>__namedExportsOrder,default:()=>reader_doc_component_stories});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var reader_doc_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/reader-doc/reader-doc.component.css?ngResource"),reader_doc_componentngResource_default=__webpack_require__.n(reader_doc_componentngResource),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ngneat_transloco=__webpack_require__("./node_modules/@ngneat/transloco/fesm2022/ngneat-transloco.mjs"),marked_esm=__webpack_require__("./node_modules/marked/lib/marked.esm.js");const ALLOWED_SCHEMES=new Set(["http:","https:","mailto:"]);function slug(text){return text.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"")||"section"}function urlAllowed(href){const value=href.trim();if(""===value)return!1;if(/[\0-]/.test(value))return!1;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(value))return!0;try{return ALLOWED_SCHEMES.has(new URL(value).protocol)}catch{return!1}}class Collector{names=new Set;total=0;add(name){this.names.add(name),this.total+=1}result(){return{count:this.total,tags:[...this.names].sort()}}}function instance(collector){return new marked_esm.Dz({renderer:{html:token=>(function openingTags(raw){return[...raw.replaceAll(/<!--[\s\S]*?-->/g,"").matchAll(/<([a-zA-Z][a-zA-Z0-9-]*)/g)].map(m=>m[1].toLowerCase())}(token.raw??token.text??"").forEach(name=>collector.add(name)),""),heading(token){const text=this.parser.parseInline(token.tokens),id=slug(token.text);return`<h${token.depth} id="${id}">${text}</h${token.depth}>\n`},link(token){const text=this.parser.parseInline(token.tokens);if(!urlAllowed(token.href))return collector.add("a"),text;const title=token.title?` title="${escapeAttribute(token.title)}"`:"";return`<a href="${escapeAttribute(token.href)}"${title}>${text}</a>`},table(token){return marked_esm.A4.prototype.table.call(this,token).replace("<table>",'<table class="ui">')},image(token){if(!urlAllowed(token.href))return collector.add("img"),"";const title=token.title?` title="${escapeAttribute(token.title)}"`:"";return`<img src="${escapeAttribute(token.href)}" alt="${escapeAttribute(token.text)}"${title} />`}}})}function escapeAttribute(value){return value.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">")}function toView(markdown,marked){const tokens=marked.lexer(markdown),lead=[],sections=[];for(const token of tokens){if("heading"===token.type&&2===token.depth){const heading=token;sections.push({id:slug(heading.text),title:heading.text,tokens:[]});continue}const current=sections.at(-1);(void 0===current?lead:current.tokens).push(token)}return{lead:marked.parser(lead),sections:sections.map(section=>({id:section.id,title:section.title,html:marked.parser(section.tokens)}))}}let UiReaderDocComponent=class UiReaderDocComponent{markdown=(0,core.input)(null);error=(0,core.input)(null);notice=(0,core.input)("none");contentLang=(0,core.input)(null);stand=(0,core.input)(null);downloadHref=(0,core.input)(null);downloadName=(0,core.input)(null);printable=(0,core.input)(!1);document=(0,_effect_chunk2.WQX)(_effect_chunk2.qQL);rendered=(0,_resource_chunk.EW)(()=>function renderReaderDocument(markdown=""){const collector=new Collector;return{full:toView(markdown,instance(collector)),dropped:collector.result()}}(this.markdown()??""));dropped=(0,_resource_chunk.EW)(()=>this.rendered().dropped);lead=(0,_resource_chunk.EW)(()=>this.rendered().full.lead);sections=(0,_resource_chunk.EW)(()=>this.rendered().full.sections);hasBar=(0,_resource_chunk.EW)(()=>"none"!==this.notice()||this.dropped().count>0||null!==this.downloadHref()||this.printable());isEmpty=(0,_resource_chunk.EW)(()=>{const doc=this.rendered().full;return""===doc.lead.trim()&&0===doc.sections.length});print(){this.document.defaultView?.print()}static propDecorators={markdown:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"markdown",required:!1,transform:void 0}]}],error:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"error",required:!1,transform:void 0}]}],notice:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"notice",required:!1,transform:void 0}]}],contentLang:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"contentLang",required:!1,transform:void 0}]}],stand:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"stand",required:!1,transform:void 0}]}],downloadHref:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"downloadHref",required:!1,transform:void 0}]}],downloadName:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"downloadName",required:!1,transform:void 0}]}],printable:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"printable",required:!1,transform:void 0}]}]}};UiReaderDocComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-reader-doc",template:'@if (error(); as message) {\n <p class="_state _error" role="alert">{{ message }}</p>\n} @else if (isEmpty()) {\n <p class="_state _empty" role="alert">{{ \'reader.empty\' | transloco }}</p>\n} @else {\n @if (hasBar()) {\n <header class="_bar">\n <div class="_notices">\n @switch (notice()) {\n @case (\'source-language\') {\n <p class="_notice">\n {{ \'reader.sourceLanguage\' | transloco: { lang: contentLang() ?? \'\' } }}\n </p>\n }\n @case (\'fallback\') {\n <p class="_notice _defect" role="alert">\n {{ \'reader.fallback\' | transloco: { lang: contentLang() ?? \'\' } }}\n </p>\n }\n }\n\n \x3c!-- Not switchable off: it appears only when content really was left\n out, and a reader that keeps that to itself is lying quietly. --\x3e\n @if (dropped().count > 0) {\n <p class="_notice _dropped">\n {{\n \'reader.dropped\'\n | transloco: { count: dropped().count, tags: dropped().tags.join(\', \') }\n }}\n </p>\n }\n </div>\n\n <div class="_actions">\n \x3c!-- Icon buttons in the library\'s own shape: the glyph is the content,\n the wording lives in `title` so it stays translated and reachable. --\x3e\n @if (downloadHref(); as href) {\n <a\n class="ui-icon _download"\n [href]="href"\n [attr.download]="downloadName() ?? \'\'"\n [title]="\'reader.download\' | transloco"\n [attr.aria-label]="\'reader.download\' | transloco"\n >file_download</a\n >\n }\n @if (printable()) {\n <button\n type="button"\n class="ui-icon _print"\n [title]="\'reader.print\' | transloco"\n [attr.aria-label]="\'reader.print\' | transloco"\n (click)="print()"\n >\n print\n </button>\n }\n </div>\n </header>\n }\n\n <article class="_doc">\n \x3c!-- The HTML comes from the renderer next door, which can only produce the\n tags marked builds itself. Angular\'s sanitiser still runs over it — a\n second net costs nothing here, and nothing is waved through. --\x3e\n <div class="_lead" [innerHTML]="lead()"></div>\n\n @for (section of sections(); track section.id) {\n <section class="_section">\n <h2 [id]="section.id">{{ section.title }}</h2>\n <div [innerHTML]="section.html"></div>\n </section>\n }\n </article>\n\n @if (stand(); as date) {\n <footer class="_stand">{{ \'reader.stand\' | transloco: { date: date } }}</footer>\n }\n}\n',encapsulation:_debug_node_chunk.gXe.None,imports:[ngneat_transloco.Kj],styles:[reader_doc_componentngResource_default()]})],UiReaderDocComponent);const reader_doc_component_stories={title:"Atoms/ReaderDoc",component:UiReaderDocComponent,argTypes:{notice:{control:"select",options:["none","source-language","fallback"]},printable:{control:"boolean"}}},noControls={controls:{disable:!0}},render=args=>({props:{...args},template:'\n <ui-reader-doc\n class="block max-w-3xl border border-c-secondary p-6"\n [markdown]="markdown"\n [error]="error"\n [notice]="notice"\n [contentLang]="contentLang"\n [stand]="stand"\n [downloadHref]="downloadHref"\n [downloadName]="downloadName"\n [printable]="printable"\n ></ui-reader-doc>\n '}),base={markdown:"# Demo document\n\nThis document exists to be read by the component below. Everything in it\ndemonstrates one of the shapes the renderer handles.\n\n- a list item, which carries the gear instead of a bullet on paper\n- a second one, so the spacing has something to show\n\nA [link that is kept](https://moja.work) and `inline code`.\n\n## A section\n\nSecond-level headings start a section. This paragraph sits inside one.\n\n| Column | Column |\n| --- | --- |\n| cell | cell |\n\n## Another section\n\n```\na code block keeps itself whole\n```\n",error:null,notice:"none",contentLang:null,stand:null,downloadHref:null,downloadName:null,printable:!1},Default={args:{...base},render},WaysOut={parameters:noControls,args:{...base,downloadHref:"assets/ui/documents/demo.pdf",downloadName:"demo.pdf",printable:!0,stand:"2026-08-15"},render},Figure={parameters:noControls,args:{...base,markdown:"# Demo document\n\nA paragraph that holds nothing but an image is a figure and stands centred.\nThe one below links somewhere as well — a linked image is a figure too.\n\n[](https://moja.work)\n\nProse with an image inside keeps its flow: \nthe picture sits in the line where the author put it.\n"},render},CodeInNarrowCell={parameters:noControls,args:{...base,markdown:"# Demo document\n\nInline code is one token and never wraps, however narrow the cell — the text\naround it breaks instead. A code block keeps its own breaks and scrolls.\n\n| App | What it is |\n| --- | --- |\n| `change-me` | A long description that takes the width, so the first column is squeezed to what the name needs and not one character more |\n| `another-long-name` | The same again, a second row so the column has to agree on one width for both names |\n"},render},SourceLanguage={parameters:noControls,args:{...base,notice:"source-language",contentLang:"EN"},render},FallbackDefect={parameters:noControls,args:{...base,notice:"fallback",contentLang:"EN"},render},DroppedMarkup={parameters:noControls,args:{...base,markdown:"# Demo document\n\nThis document contains <b>raw HTML</b> and a <details>block element</details>.\nThe words survive, the markup does not — and the notice above says so.\n"},render},Empty={parameters:noControls,args:{...base,markdown:""},render},Failed={parameters:noControls,args:{...base,error:"The source did not answer."},render},__namedExportsOrder=["Default","WaysOut","Figure","CodeInNarrowCell","SourceLanguage","FallbackDefect","DroppedMarkup","Empty","Failed"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"{\n args: {\n ...base\n },\n render\n}",...Default.parameters?.docs?.source},description:{story:"Reading, and nothing else. No buttons, because none were handed in — a\nbutton appears only when it can keep its promise.",...Default.parameters?.docs?.description}}},WaysOut.parameters={...WaysOut.parameters,docs:{...WaysOut.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n // A real, tiny PDF from the library's own assets — a stand-in that says\n // it is one when you open it. The previous one was text under a `.pdf`\n // name, so every click ended in \"the file could not be opened\": a story\n // teaching that the download is broken.\n downloadHref: 'assets/ui/documents/demo.pdf',\n downloadName: 'demo.pdf',\n printable: true,\n stand: '2026-08-15'\n },\n render\n}",...WaysOut.parameters?.docs?.source},description:{story:"Both ways out. The download is the main way and carries the weight; printing\nis the side way. The file is handed in as an address — the component makes\nnothing.",...WaysOut.parameters?.docs?.description}}},Figure.parameters={...Figure.parameters,docs:{...Figure.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n markdown: WITH_FIGURE\n },\n render\n}",...Figure.parameters?.docs?.source},description:{story:"A lone image is a figure: centred, whether it links somewhere or not. An\nimage inside prose is not — it stays in its line. The renderer draws no\nframe and no caption; where the picture stands is all it decides.",...Figure.parameters?.docs?.description}}},CodeInNarrowCell.parameters={...CodeInNarrowCell.parameters,docs:{...CodeInNarrowCell.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n markdown: WITH_CODE_IN_CELL\n },\n render\n}",...CodeInNarrowCell.parameters?.docs?.source},description:{story:"Inline code in a squeezed table cell: the hyphenated names stay on one line\neach, the description column takes the break.",...CodeInNarrowCell.parameters?.docs?.description}}},SourceLanguage.parameters={...SourceLanguage.parameters,docs:{...SourceLanguage.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n notice: 'source-language',\n contentLang: 'EN'\n },\n render\n}",...SourceLanguage.parameters?.docs?.source},description:{story:"The quiet note: the text is in its source language and that is expected. It\nmust be distinguishable at a glance from the state below — that is the whole\nreason they are two states.",...SourceLanguage.parameters?.docs?.description}}},FallbackDefect.parameters={...FallbackDefect.parameters,docs:{...FallbackDefect.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n notice: 'fallback',\n contentLang: 'EN'\n },\n render\n}",...FallbackDefect.parameters?.docs?.source},description:{story:'The defect: the requested language is missing although it should exist. It\ncarries the error colour and `role="alert"`, because a fallback nobody\nnotices is how an English page ends up in a German view unremarked.',...FallbackDefect.parameters?.docs?.description}}},DroppedMarkup.parameters={...DroppedMarkup.parameters,docs:{...DroppedMarkup.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n markdown: WITH_HTML\n },\n render\n}",...DroppedMarkup.parameters?.docs?.source},description:{story:"Raw HTML is discarded, and the reader says so with a count and the element\nnames. There is no input that hides this: the notice only ever appears when\nsomething really was left out.",...DroppedMarkup.parameters?.docs?.description}}},Empty.parameters={...Empty.parameters,docs:{...Empty.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n markdown: ''\n },\n render\n}",...Empty.parameters?.docs?.source},description:{story:"Nothing to read is a loud state, never a blank area that reads as a broken component.",...Empty.parameters?.docs?.description}}},Failed.parameters={...Failed.parameters,docs:{...Failed.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n error: 'The source did not answer.'\n },\n render\n}",...Failed.parameters?.docs?.source},description:{story:"A failure the placer wants shown in its own words, in place of the document.",...Failed.parameters?.docs?.description}}}},"./libs/ui/src/lib/atoms/reader-doc/reader-doc.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n/* The reader on SCREEN, and nothing but. The document area stays neutral —\n this component carries foreign text, and a reader that decorates what it\n displays makes every source look like it was written in this house.\n\n It hangs on nothing outside itself: no stylesheet is imported, no class is\n left in the output as a hook for one, and no other file is named here as\n the other half of a design. Whatever this looks like is decided in this\n file.\n\n Encapsulation is None, so everything hangs under the tag. */\n\nui-reader-doc {\n display: block;\n color: var(--ui-c-default);\n\n /* ---- states that replace the document ---- */\n\n ._state {\n /* Centred in both directions: these two replace the whole document, so the\n sentence stands in the middle of the space the text would have had\n rather than in its top-left corner like a first paragraph. */\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: var(--ui-spacer);\n border-radius: var(--ui-border-radius);\n background-color: var(--ui-c-primary);\n color: var(--ui-c-primary-invert);\n }\n\n /* A tint rather than a slab of red, and the sentence in the error colour\n itself — the same pair the fallback notice uses, one step louder. A filled\n red block reads as a warning sign; this reads as a message that went\n wrong, which is what it is. */\n ._state._error {\n border: var(--ui-border-width) solid var(--ui-c-error);\n background-color: color-mix(in srgb, var(--ui-c-error) 20%, transparent);\n color: var(--ui-c-error);\n font-weight: bold;\n }\n\n /* ---- the bar above the document ---- */\n\n ._bar {\n display: flex;\n flex-wrap: wrap;\n gap: calc(var(--ui-spacer) * 0.5);\n justify-content: space-between;\n align-items: flex-start;\n /* Half a spacer, the same step the bar uses between its own parts. A full\n one left the notice floating well clear of the text it is about. */\n margin-bottom: calc(var(--ui-spacer) * 0.5);\n }\n\n ._notices {\n display: flex;\n flex-direction: column;\n gap: calc(var(--ui-spacer) * 0.25);\n flex: 1 1 20rem;\n }\n\n ._notice {\n margin: 0;\n padding: calc(var(--ui-spacer) * 0.5);\n border: var(--ui-border-width) solid var(--ui-c-secondary);\n border-radius: var(--ui-border-radius);\n /* A tint of the border's own colour, mixed against whatever lies behind\n it — so the note carries in both themes without a second token. */\n background-color: color-mix(in srgb, var(--ui-c-secondary) 12%, transparent);\n font-size: 0.9em;\n }\n\n /* A fallback is a DEFECT and looks like one. It must never be mistaken for\n the quiet note that a text is simply in its source language — that is the\n whole reason the two are separate states. */\n ._notice._defect {\n border-color: var(--ui-c-error);\n background-color: color-mix(in srgb, var(--ui-c-error) 10%, transparent);\n color: var(--ui-c-error);\n font-weight: bold;\n }\n\n ._actions {\n display: flex;\n gap: calc(var(--ui-spacer) * 0.25);\n align-items: center;\n }\n\n /* The print button needs nothing here: `ui-icon` puts it under the library's\n own button rule, which is where the splitter's icon row gets its look\n from. The download cannot use that rule — it is an `<a>`, because `href`\n and `download` belong on a link — so the rule's declarations are mirrored\n for it, token for token, rather than a second button design invented next\n to it. Size and padding come from `.ui-icon` for both. */\n ._actions ._download {\n background-color: var(--ui-c-fourthly);\n border: var(--ui-border-width) solid transparent;\n border-radius: var(--ui-border-radius);\n box-shadow: 0 0 var(--ui-button-shadow) 0 var(--ui-c-thirdly);\n color: var(--ui-c-default);\n font-weight: 400;\n text-decoration: none;\n cursor: pointer;\n }\n\n ._actions button:hover,\n ._actions a:hover {\n color: var(--ui-c-focus);\n }\n\n ._actions button:focus-visible,\n ._actions a:focus-visible {\n outline: var(--ui-border-width) solid var(--ui-c-focus);\n outline-offset: 2px;\n }\n\n /* ---- the document ---- */\n\n ._doc {\n line-height: 165%;\n }\n\n /* Headings are told apart by size and air, not by decoration. The library\n already sizes h1..h3 globally, so the document needs nothing beyond room\n around them — a reader carries a foreign text and must not push a house\n style onto it. */\n ._doc h1,\n ._doc h2 {\n /* In `em`, so the air scales with the heading rather than with the layout\n spacer — that one is 4rem and turned every heading into a clearing.\n More room above than below: a heading belongs to the text under it. */\n margin: 1.2em 0 0.4em;\n font-weight: normal;\n line-height: 140%;\n }\n\n ._doc ._lead > :first-child {\n margin-top: 0;\n }\n\n /* A step under every block that carries text, so a paragraph, a section body\n and a table never sit flush against whatever follows them. */\n ._doc div,\n ._doc p {\n padding-bottom: calc(var(--ui-spacer) * 0.25);\n }\n\n /* A table takes its step as margin: `table.ui` collapses its borders, and in\n that model the browser ignores padding on the table itself — the text\n after it sat flush against the last row. */\n ._doc table {\n margin-bottom: calc(var(--ui-spacer) * 0.5);\n }\n\n /* The fold keeps the browser's own marker. A section that folds has to look\n like it does, and the platform's triangle says so in the reader's own\n idiom — a house shape here would be the reader's design talking over the\n document's. */\n ._doc a {\n color: var(--ui-c-default);\n text-decoration: underline;\n text-decoration-color: var(--ui-c-secondary);\n }\n\n ._doc img {\n max-width: 100%;\n }\n\n /* A paragraph that holds nothing but an image — or an image that is a link —\n is a figure, and a figure stands centred. That is the one place the reader\n decides a position for the author: Markdown has no way to say it, and a\n picture flush left under a table reads as a mistake, not as a choice.\n Prose with an image inside keeps its flow; only the lone image moves. */\n ._doc p:has(> img:only-child),\n ._doc p:has(> a:only-child > img:only-child) {\n text-align: center;\n\n /* The Tailwind preflight makes every img a block, and a block ignores\n text-align; the figure is laid out as a block of its own width in the\n middle of the line, which is what \"centred\" means for either display. */\n img {\n display: inline-block;\n }\n }\n\n /* A token is one thing. Inline code names an identifier, a file, a flag —\n and an identifier cut at its hyphen (`change-` / `me`) is no longer the\n thing it names. So code in running text never wraps; the line around it\n does. A code BLOCK is not this: `pre` keeps its own breaks and scrolls. */\n ._doc :not(pre) > code {\n white-space: nowrap;\n }\n\n ._doc pre {\n padding: calc(var(--ui-spacer) * 0.5);\n border: var(--ui-border-width) solid var(--ui-c-secondary);\n border-radius: var(--ui-border-radius);\n overflow-x: auto;\n }\n\n /* Tables carry `class=\"ui\"` from the renderer and take the library's own\n table design with it — see Styling / Tags. A second table style in this\n component is exactly the house design the document area must not bring. */\n ._doc table.ui {\n width: 100%;\n\n /* A cell reads from its first line. Browsers centre cells vertically, so a\n one-word key next to a three-line description floats mid-air and the\n eye has to find the row it belongs to; at the top, key and text start\n together. That is reading, not design — the look stays the library's. */\n th,\n td {\n vertical-align: top;\n }\n }\n\n ._doc blockquote {\n margin: 0 0 calc(var(--ui-spacer) * 0.5);\n padding-left: var(--ui-spacer);\n border-left: calc(var(--ui-border-width) * 2) solid var(--ui-c-secondary);\n }\n\n ._stand {\n margin-top: var(--ui-spacer);\n font-size: 0.85em;\n color: var(--ui-c-secondary);\n }\n\n /* ---- the side way ----\n A print of the PAGE, not a paper design: the chrome goes and the breaks\n are kept off headings, so a sheet coming out of a browser is readable.\n That is the whole of it. What a document looks like on paper as a\n designed thing is not this component's question, and nothing here knows\n of an answer to it. */\n @media print {\n ._bar ._actions,\n ._stand {\n display: none;\n }\n\n ._doc h1,\n ._doc h2,\n ._doc li,\n ._doc pre,\n ._doc blockquote {\n break-inside: avoid;\n }\n\n ._doc h1,\n ._doc h2,\n ._doc h3 {\n break-after: avoid;\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[4713],{"./node_modules/css-loader/dist/runtime/api.js"(module){"use strict";module.exports=function(cssWithMappingToString){var list=[];return list.toString=function toString(){return this.map(function(item){var content="",needLayer=void 0!==item[5];return item[4]&&(content+="@supports (".concat(item[4],") {")),item[2]&&(content+="@media ".concat(item[2]," {")),needLayer&&(content+="@layer".concat(item[5].length>0?" ".concat(item[5]):""," {")),content+=cssWithMappingToString(item),needLayer&&(content+="}"),item[2]&&(content+="}"),item[4]&&(content+="}"),content}).join("")},list.i=function i(modules,media,dedupe,supports,layer){"string"==typeof modules&&(modules=[[null,modules,void 0]]);var alreadyImportedModules={};if(dedupe)for(var k=0;k<this.length;k++){var id=this[k][0];null!=id&&(alreadyImportedModules[id]=!0)}for(var _k=0;_k<modules.length;_k++){var item=[].concat(modules[_k]);dedupe&&alreadyImportedModules[item[0]]||(void 0!==layer&&(void 0===item[5]||(item[1]="@layer".concat(item[5].length>0?" ".concat(item[5]):""," {").concat(item[1],"}")),item[5]=layer),media&&(item[2]?(item[1]="@media ".concat(item[2]," {").concat(item[1],"}"),item[2]=media):item[2]=media),supports&&(item[4]?(item[1]="@supports (".concat(item[4],") {").concat(item[1],"}"),item[4]=supports):item[4]="".concat(supports)),list.push(item))}},list}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js"(module){"use strict";module.exports=function(i){return i[1]}},"./libs/ui/src/lib/atoms/typewriter/typewriter.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Typewriter:()=>Typewriter,__namedExportsOrder:()=>__namedExportsOrder,default:()=>typewriter_component_stories});var dist=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var typewriter_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/typewriter/typewriter.component.css?ngResource"),typewriter_componentngResource_default=__webpack_require__.n(typewriter_componentngResource),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs");let UiTypewriterComponent=class UiTypewriterComponent{text=core.input.required();speed=(0,core.input)(50);volume=(0,core.input)(.2);sound=(0,core.input)(!0,{transform:core.booleanAttribute});src=(0,core.input)("https://moja.work/media/sounds/type.mp3");typingFinish=(0,core.output)();currentIndex=(0,_effect_chunk2.vPA)(0);audioHit=new Audio;displayedText=(0,_resource_chunk.EW)(()=>this.text().slice(0,Math.max(0,this.currentIndex())));constructor(){(0,_effect_chunk2.QZP)(onCleanup=>{const length=this.text().length,speed=this.speed();(0,_resource_chunk.O8)(()=>this.currentIndex.set(0));const timer=setInterval(()=>{if(this.currentIndex()<length)return this.currentIndex.update(i=>i+1),void this.playAudio();clearInterval(timer),this.typingFinish.emit()},speed);onCleanup(()=>clearInterval(timer))}),(0,_effect_chunk2.QZP)(()=>{if(!this.sound())return;const src=this.src();this.audioHit.src.includes(src)&&this.audioHit.readyState>=3||(this.audioHit.src=src,this.audioHit.load())}),(0,_effect_chunk2.QZP)(()=>{this.audioHit.volume=this.volume()})}playAudio(){if(!this.sound())return;const audio=this.audioHit.cloneNode();audio.volume=this.audioHit.volume,Promise.resolve(audio.play()).catch(()=>{})}static ctorParameters=()=>[];static propDecorators={text:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"text",required:!0,transform:void 0}]}],speed:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"speed",required:!1,transform:void 0}]}],volume:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"volume",required:!1,transform:void 0}]}],sound:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"sound",required:!1,transform:void 0}]}],src:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"src",required:!1,transform:void 0}]}],typingFinish:[{type:_debug_node_chunk.k7i,args:["typingFinish"]}]}};UiTypewriterComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-typewriter",template:'<span aria-hidden="true">{{ displayedText() }}</span><span class="_text">{{ text() }}</span>\n',styles:[typewriter_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiTypewriterComponent);const typewriter_component_stories={title:"Atoms/Typewriter",component:UiTypewriterComponent,decorators:[(0,dist.Iz)({imports:[UiTypewriterComponent]})],argTypes:{text:{control:"text"},speed:{control:{type:"range",min:10,max:500,step:10}},volume:{control:{type:"range",min:0,max:1,step:.1}},sound:{control:"boolean"},typingFinish:{table:{disable:!0}},src:{table:{disable:!0}}},args:{text:"404: Internet not found",speed:50,volume:.2,sound:!0}},Typewriter={args:{speed:120},render:args=>({props:args,template:'\n <div class="p-4">\n <ui-typewriter\n [text]="text"\n [speed]="speed"\n [volume]="volume"\n [sound]="sound">\n </ui-typewriter>\n </div>\n '})},__namedExportsOrder=["Typewriter"];Typewriter.parameters={...Typewriter.parameters,docs:{...Typewriter.parameters?.docs,source:{originalSource:'{\n args: {\n speed: 120\n },\n render: args => ({\n props: args,\n template: `\n <div class="p-4">\n <ui-typewriter\n [text]="text"\n [speed]="speed"\n [volume]="volume"\n [sound]="sound">\n </ui-typewriter>\n </div>\n `\n })\n}',...Typewriter.parameters?.docs?.source}}}},"./libs/ui/src/lib/atoms/typewriter/typewriter.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n display: inline-block;\n white-space: pre-wrap;\n}\n\n/* The whole text once, for assistive technology — the revealed part beside\n it is hidden from a reader, which would otherwise get a sentence in\n pieces. Visually removed, not `display: none`, so it is still read. */\n:host ._text {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[943,8938],{"./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiImageGridClickAreaDirective});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs");let UiImageGridClickAreaDirective=class UiImageGridClickAreaDirective{template=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.C4Q);static ngTemplateContextGuard(_directive,_context){return!0}};UiImageGridClickAreaDirective=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.WLR)({selector:"ng-template[uiImageGridClickArea]"})],UiImageGridClickAreaDirective)},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{p:()=>UiImageGridComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var image_grid_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"),image_grid_componentngResource_default=__webpack_require__.n(image_grid_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),resize_signal=__webpack_require__("./libs/ui/src/lib/helpers/resize-signal.ts"),image_grid_click_area_directive=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts");let UiImageGridComponent=class UiImageGridComponent{get scrollerHeightValue(){return this.scrollerHeight()}scroller;imageContainer;clickArea=(0,core.contentChild)(image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q});resizeEvent=(0,resize_signal.H)();data=(0,core.input)(null);dataCount=(0,_resource_chunk.EW)(()=>this.data()?.length??0);dataCountItems=(0,_effect_chunk2.vPA)([0]);debug=(0,core.input)(!1);singleRow=(0,core.input)(!1);gap=(0,core.input)(0);overlayType=(0,core.input)("default");overlayTypeClass=(0,_resource_chunk.EW)(()=>`_-${this.overlayType()}`);cols=(0,core.input)(0);height=(0,core.input)();action=(0,core.input)(!1);loaded=(0,core.input)(!1);setIndex=(0,core.input)(0);currentIndex=(0,core.output)();clickIndex=(0,core.output)();scrollerHeight=(0,_resource_chunk.EW)(()=>{const height=this.height(),cols=this.cols();return this.singleRow()&&height&&cols?height/cols+"px":height?`${height}px`:"200px"});gridColsInternal=(0,_resource_chunk.EW)(()=>{const counter=this.cols();return 0!==counter&&this.dataCount()/counter>counter?Math.ceil(this.dataCount()/counter):counter});active=(0,_effect_chunk2.vPA)(null);hideDisplay=(0,_effect_chunk2.vPA)(!0);clickAreaExist=(0,_resource_chunk.EW)(()=>void 0!==this.clickArea());constructor(){(0,_effect_chunk2.QZP)(()=>{this.gap(),this.height(),this.cols(),this.resizeEvent(),this.updateGrid()}),(0,_effect_chunk2.QZP)(()=>{this.setIndex(),this.scrollToChild(this.setIndex()),this.active.set(this.setIndex())}),(0,_effect_chunk2.QZP)(()=>{this.action(),this.active.set(null)})}ngAfterViewInit(){this.active.set(this.setIndex()),this.updateGrid(),this.fader()}clickAreaContext(index){const item=this.data()?.[index];return item?{$implicit:item,index}:null}updateGrid(){const scroller=this.scroller?.nativeElement;scroller&&(scroller.style.height=this.scrollerHeight());const element=this.imageContainer?.nativeElement;if(element&&this.dataCount()){const gap=this.gap();this.dataCountItems.set(Array.from({length:this.gridColsInternal()*this.gridColsInternal()},(_,index)=>index+1));const repeatCount=this.singleRow()?this.dataCount():this.gridColsInternal();setTimeout(()=>{element.style.display="grid",element.style.gap=`${gap}px`,element.style.gridTemplateColumns=`repeat(${repeatCount}, 1fr)`,this.applyStylesToChildren()},100)}}calculateGridSize(containerSize){const adjustedSize=containerSize/this.cols()-this.gap();return Math.ceil(adjustedSize)}applyStylesToChildren(){const element=this.imageContainer?.nativeElement;if(element){const width=this.calculateGridSize(element.offsetWidth??0),height=this.singleRow()?element.offsetHeight:this.calculateGridSize(element.offsetHeight??0),applyChildStyles=child=>{child.style.height=`${height}px`,child.style.width=`${width}px`};element.childNodes.forEach(child=>{child instanceof HTMLElement&&applyChildStyles(child)})}}fader(){this.hideDisplay.set(!0),setTimeout(()=>{this.hideDisplay.set(!1)},800)}scrollToChild(index){const containerElement=this.imageContainer?.nativeElement;if(!containerElement)return;const targetChild=containerElement.childNodes[index];if(!(targetChild instanceof HTMLElement))return;const scrollOffset=this.calculateScrollOffset(containerElement,targetChild);this.scroller?.nativeElement.scrollTo({left:scrollOffset,top:0})}calculateScrollOffset(container,child){return child.offsetLeft-container.offsetWidth/2+child.offsetWidth/2}useAction(index){this.action()&&this.imageSrc(index)&&(this.clickAreaExist()&&this.active()===index&&this.clickIndex.emit(index),this.currentIndex.emit(index),this.active.set(index),this.scrollToChild(index))}scale(index){const value=this.data()?.[index]?.src.scale;return`transform: scale(${value??1})`}imageSrc(index){return this.data()?.[index]?.src.default}imageAlt(index){return this.data()?.[index]?.alt}imageTitle(index){return this.data()?.[index]?.title}static ctorParameters=()=>[];static propDecorators={scrollerHeightValue:[{type:_debug_node_chunk.g$6,args:["style.height"]}],scroller:[{type:core.ViewChild,args:["scroller"]}],imageContainer:[{type:core.ViewChild,args:["imageContainer"]}],clickArea:[{type:core.ContentChild,args:[image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q,isSignal:!0}]}],data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}],debug:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"debug",required:!1,transform:void 0}]}],singleRow:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"singleRow",required:!1,transform:void 0}]}],gap:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"gap",required:!1,transform:void 0}]}],overlayType:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"overlayType",required:!1,transform:void 0}]}],cols:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"cols",required:!1,transform:void 0}]}],height:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"height",required:!1,transform:void 0}]}],action:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"action",required:!1,transform:void 0}]}],loaded:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"loaded",required:!1,transform:void 0}]}],setIndex:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"setIndex",required:!1,transform:void 0}]}],currentIndex:[{type:_debug_node_chunk.k7i,args:["currentIndex"]}],clickIndex:[{type:_debug_node_chunk.k7i,args:["clickIndex"]}]}};UiImageGridComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-image-grid",template:'@if (data()) {\n <div class="_scroller" #scroller>\n <div\n #imageContainer\n class="_image-container"\n [class._-hide-display]="hideDisplay()"\n >\n @for (item of dataCountItems(); track item; let i = $index) {\n <button\n class="_wrapper"\n [class._-action]="action() && imageSrc(i)"\n [class._-active]="active() === i"\n [class._-no-image]="!imageSrc(i)"\n [class]="overlayTypeClass()"\n (click)="useAction(i)"\n >\n @if (debug()) {\n dataCount: {{ this.dataCount() }} <br />\n internalCounter: {{ this.gridColsInternal() }} <br />\n counter: {{ this.cols() }} <br />\n src: {{ imageSrc(i) }}\n } @else {\n @if (imageSrc(i) && loaded()) {\n <figure>\n <img\n [style]="scale(i)"\n [src]="imageSrc(i)"\n [alt]="imageAlt(i)"\n [title]="imageTitle(i)"\n />\n </figure>\n @if (clickArea(); as template) {\n <div class="_click-area">\n <ng-container\n *ngTemplateOutlet="template; context: clickAreaContext(i)"\n ></ng-container>\n </div>\n }\n } @else {\n \x3c!-- No picture: the same shape the image editor uses — icon\n centred, whatever title the item carries underneath. No\n stand-in text: an empty title is the caller\'s business. --\x3e\n <div class="_empty">\n <span class="ui-icon x3" aria-hidden="true">image</span>\n <strong>{{ imageTitle(i) }}</strong>\n </div>\n }\n }\n </button>\n }\n </div>\n </div>\n}\n',imports:[_common_module_chunk.T3],styles:[image_grid_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiImageGridComponent)},"./libs/ui/.storybook/blocks/guide.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Ay:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_guide_entries__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/blocks/guide.entries.js"),_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.model.mjs");const Link=({href,children})=>href?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.zE,{href,children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children}),Sentences=({items})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul",{children:items.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li",{children:s},i))}),Block=({of,entry})=>{const m=(0,_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__.Cc)(entry,_guide_entries__WEBPACK_IMPORTED_MODULE_4__.H,of);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section",{className:"ui-guide",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("h4",{children:["Guide — a recommendation, not the truth",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[" · reviewed ",m.reviewed]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:["Written by an agent from the sources below, only for what runs in the house."," ","component"===m.kind?"The section above is what the component does; this is what to reach for it for.":"The pages of the parts say what each does; this is what they are for together."," ","Where the two disagree, the page wins."]}),m.uses.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Builds on"})," ",m.uses.map((u,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:u.href,children:u.selector})]},u.selector))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Use it for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.useFor}),m.notFor.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Not for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.notFor})]}),m.instead.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Instead"})," ",m.instead.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.selector})]},s.selector))]}),m.note&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Note"})," ",m.note]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Shown in"})," ",m.shownIn.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&" · ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.label})]},s.label))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Sources"})," ",m.sources.join(" · ")]})})]})};function _createMdxContent(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:["\n","\n","\n","\n","\n","\n","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Block,{of:props.of,entry:props.entry})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/.storybook/demos/examples/image-grid-slider/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_image_grid_slider_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/demos/examples/image-grid-slider/image-grid-slider.stories.ts"),_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_image_gallery_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/image-gallery.json");function _createMdxContent(props){const _components={a:"a",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_image_grid_slider_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"example-image-gallery",children:"Example Image Gallery"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Two atoms, one index: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-image-grid"})," for the overview, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-image-slider"}),"\nfor the single picture. This page shows the two ways they are wired; what\neach of them takes and emits is on their own pages —\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/docs/atoms-image-grid--docs",children:"Image Grid"})," and\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/docs/atoms-image-slider--docs",children:"Image Slider"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"image-gallery",entry:_guide_image_gallery_json__WEBPACK_IMPORTED_MODULE_6__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-side-by-side",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/examples-image-gallery--image-gallery",children:"Open story: side by side"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Both are visible, and both read and write the same index: a click in the\ngrid moves the slider, a step in the slider moves the grid's selection."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-slider\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [zoom]="false">\n</ui-image-slider>\n\n<ui-image-grid\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [action]="true"\n [loaded]="true"\n [height]="400"\n [cols]="3"\n [gap]="10">\n</ui-image-grid>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-zoom-on-demand",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/examples-image-gallery--image-gallery-zoom",children:"Open story: zoom on demand"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The slider exists only while it is open. It takes two clicks, by design of\nthe grid: the first click ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"selects"})," a tile, the second — on the selected\ntile's click area, the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<ng-template uiImageGridClickArea>"})," projected into the grid and stamped\ninto every tile with the tile's item — emits ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"clickIndex"}),". That creates the\nslider in zoom; the slider's own close hands ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"currentZoom"})," back as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"false"}),",\nand the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"@if"})," removes it again."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-grid\n [data]="data"\n [setIndex]="index"\n (clickIndex)="index=$event; zoom=true"\n [action]="true"\n [loaded]="true"\n overlayType="doors"\n [height]="480"\n [cols]="3"\n [gap]="10">\n <ng-template uiImageGridClickArea let-item>\n <div>{{ item.title }}</div>\n </ng-template>\n</ui-image-grid>\n\n@if (zoom) {\n <ui-image-slider\n [data]="data"\n [setIndex]="index"\n (currentIndex)="index=$event"\n (currentZoom)="zoom=$event"\n [zoom]="zoom">\n </ui-image-slider>\n}\n'})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/.storybook/demos/examples/image-grid-slider/image-grid-slider.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ImageGallery:()=>ImageGallery,ImageGalleryZoom:()=>ImageGalleryZoom,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _storybook_angular__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),_src_lib_atoms_image_grid_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"),_src_lib_atoms_image_grid_image_grid_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts"),_src_lib_atoms_image_slider_image_slider_component__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./libs/ui/src/lib/atoms/image-slider/image-slider.component.ts"),_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image.mock.ts"),_header_header_component__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Examples/Image Gallery",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_0__.Iz)({imports:[_header_header_component__WEBPACK_IMPORTED_MODULE_5__.b,_src_lib_atoms_image_grid_image_grid_component__WEBPACK_IMPORTED_MODULE_2__.p,_src_lib_atoms_image_grid_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_1__.u,_src_lib_atoms_image_slider_image_slider_component__WEBPACK_IMPORTED_MODULE_3__.u]})]},ImageGallery={render:args=>({props:{...args,data:(0,_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__.W)(),currentIndex:0},template:'\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="flex flex-col">\n <ui-image-slider\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [zoom]="false">\n </ui-image-slider>\n <div class="relative h-[400px] mt-(--ui-spacer)">\n <ui-image-grid\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [action]="true"\n [loaded]="true"\n [height]="400"\n [cols]="3"\n [gap]="10">\n </ui-image-grid>\n </div>\n </section>\n '})},ImageGalleryZoom={render:args=>({props:{...args,data:(0,_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__.W)(),index:0,zoom:!1},template:'\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [data]="data"\n [setIndex]="index"\n (clickIndex)="index=$event;zoom=true"\n [action]="true"\n [loaded]="true"\n overlayType="doors"\n [height]="480"\n [cols]="3"\n [gap]="10">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background p-2">{{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n @if(zoom) {\n <ui-image-slider\n [data]="data"\n [setIndex]="index"\n (currentIndex)="index=$event"\n (currentZoom)="zoom=$event"\n [zoom]="zoom"></ui-image-slider>\n }\n </section>\n '})},__namedExportsOrder=["ImageGallery","ImageGalleryZoom"];ImageGallery.parameters={...ImageGallery.parameters,docs:{...ImageGallery.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args,\n data: uiImageMock(),\n currentIndex: 0\n },\n template: `\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="flex flex-col">\n <ui-image-slider\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [zoom]="false">\n </ui-image-slider>\n <div class="relative h-[400px] mt-(--ui-spacer)">\n <ui-image-grid\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [action]="true"\n [loaded]="true"\n [height]="400"\n [cols]="3"\n [gap]="10">\n </ui-image-grid>\n </div>\n </section>\n `\n };\n }\n}',...ImageGallery.parameters?.docs?.source},description:{story:"Grid and slider side by side, sharing one index: a click in the grid moves\nthe slider, a step in the slider moves the grid's selection.",...ImageGallery.parameters?.docs?.description}}},ImageGalleryZoom.parameters={...ImageGalleryZoom.parameters,docs:{...ImageGalleryZoom.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args,\n data: uiImageMock(),\n index: 0,\n zoom: false\n },\n template: `\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [data]="data"\n [setIndex]="index"\n (clickIndex)="index=$event;zoom=true"\n [action]="true"\n [loaded]="true"\n overlayType="doors"\n [height]="480"\n [cols]="3"\n [gap]="10">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background p-2">{{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n @if(zoom) {\n <ui-image-slider\n [data]="data"\n [setIndex]="index"\n (currentIndex)="index=$event"\n (currentZoom)="zoom=$event"\n [zoom]="zoom"></ui-image-slider>\n }\n </section>\n `\n };\n }\n}',...ImageGalleryZoom.parameters?.docs?.source},description:{story:"The slider exists only while it is open. A click selects a tile; a click on\nthe selected tile's click area — the projected template, stamped per tile\nwith the tile's item — emits `clickIndex`, which creates the slider in zoom;\nthe slider's own close hands `currentZoom` back and removes it.",...ImageGalleryZoom.parameters?.docs?.description}}}},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n z-index: 0;\n --wrapper-height: 60rem;\n --button-size: 4rem;\n display: flex;\n /* Fills its container by default; the named hooks let a consumer set a fixed\n size without a cascade fight (tickets#241, tickets#251). */\n width: var(--ui-image-grid-width, 100%);\n height: var(--ui-image-grid-height, 100%);\n border-radius: calc(var(--ui-border-width) * 4);\n\n ._scroller {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n overflow-x: scroll;\n background-color: var(--ui-c-background);\n scroll-behavior: smooth;\n }\n\n ._image-container {\n position: absolute;\n top: 0;\n left: 0;\n display: grid;\n width: 100%;\n height: 100%;\n transition: opacity calc(var(--ui-time) * 0.1) linear;\n\n &._-hide-display {\n opacity: 0;\n }\n\n button._wrapper {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n gap: calc(var(--ui-spacer) * 0.5);\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: scale calc(var(--ui-time) * 0.5) ease-in-out;\n background-color: var(--ui-c-fourthly);\n border: 0;\n\n &._-no-image {\n cursor: default;\n opacity: 0.5;\n }\n\n /* The empty state, same arrangement as the image editor's: icon above,\n title below, both dimmed. */\n ._empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: calc(var(--ui-spacer) * 0.25);\n }\n\n &._-default {\n &:not(._-action) {\n cursor: default;\n }\n\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n }\n\n &._-doors {\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &::after,\n &::before {\n z-index: 1;\n content: '\\00a0';\n position: absolute;\n left: 0;\n display: flex;\n height: 100%;\n width: 100%;\n background-color: var(--ui-c-background);\n transition: var(--ui-time) ease-in-out;\n opacity: 0.6;\n }\n\n &::before {\n top: -50%;\n z-index: 1;\n }\n\n &::after {\n top: 50%;\n }\n\n &._-active::before {\n opacity: 0;\n top: -100%;\n }\n\n &._-active::after {\n opacity: 0;\n top: 100%;\n }\n }\n\n figure {\n position: relative;\n display: flex;\n flex-flow: column;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n img {\n width: auto;\n max-width: initial;\n aspect-ratio: auto;\n transition: transform calc(var(--ui-time) * 0.5) ease-in-out;\n -webkit-user-select: none;\n user-select: none;\n }\n }\n\n ._click-area {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: var(--ui-time) ease-in-out;\n }\n\n &._-active {\n ._click-area {\n opacity: 1;\n }\n }\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
package/storybook/examples-image-grid-slider-image-grid-slider-stories.028c8c2b.iframe.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[8938],{"./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiImageGridClickAreaDirective});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs");let UiImageGridClickAreaDirective=class UiImageGridClickAreaDirective{template=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.C4Q);static ngTemplateContextGuard(_directive,_context){return!0}};UiImageGridClickAreaDirective=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.WLR)({selector:"ng-template[uiImageGridClickArea]"})],UiImageGridClickAreaDirective)},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{p:()=>UiImageGridComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var image_grid_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"),image_grid_componentngResource_default=__webpack_require__.n(image_grid_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),resize_signal=__webpack_require__("./libs/ui/src/lib/helpers/resize-signal.ts"),image_grid_click_area_directive=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts");let UiImageGridComponent=class UiImageGridComponent{get scrollerHeightValue(){return this.scrollerHeight()}scroller;imageContainer;clickArea=(0,core.contentChild)(image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q});resizeEvent=(0,resize_signal.H)();data=(0,core.input)(null);dataCount=(0,_resource_chunk.EW)(()=>this.data()?.length??0);dataCountItems=(0,_effect_chunk2.vPA)([0]);debug=(0,core.input)(!1);singleRow=(0,core.input)(!1);gap=(0,core.input)(0);overlayType=(0,core.input)("default");overlayTypeClass=(0,_resource_chunk.EW)(()=>`_-${this.overlayType()}`);cols=(0,core.input)(0);height=(0,core.input)();action=(0,core.input)(!1);loaded=(0,core.input)(!1);setIndex=(0,core.input)(0);currentIndex=(0,core.output)();clickIndex=(0,core.output)();scrollerHeight=(0,_resource_chunk.EW)(()=>{const height=this.height(),cols=this.cols();return this.singleRow()&&height&&cols?height/cols+"px":height?`${height}px`:"200px"});gridColsInternal=(0,_resource_chunk.EW)(()=>{const counter=this.cols();return 0!==counter&&this.dataCount()/counter>counter?Math.ceil(this.dataCount()/counter):counter});active=(0,_effect_chunk2.vPA)(null);hideDisplay=(0,_effect_chunk2.vPA)(!0);clickAreaExist=(0,_resource_chunk.EW)(()=>void 0!==this.clickArea());constructor(){(0,_effect_chunk2.QZP)(()=>{this.gap(),this.height(),this.cols(),this.resizeEvent(),this.updateGrid()}),(0,_effect_chunk2.QZP)(()=>{this.setIndex(),this.scrollToChild(this.setIndex()),this.active.set(this.setIndex())}),(0,_effect_chunk2.QZP)(()=>{this.action(),this.active.set(null)})}ngAfterViewInit(){this.active.set(this.setIndex()),this.updateGrid(),this.fader()}clickAreaContext(index){const item=this.data()?.[index];return item?{$implicit:item,index}:null}updateGrid(){const scroller=this.scroller?.nativeElement;scroller&&(scroller.style.height=this.scrollerHeight());const element=this.imageContainer?.nativeElement;if(element&&this.dataCount()){const gap=this.gap();this.dataCountItems.set(Array.from({length:this.gridColsInternal()*this.gridColsInternal()},(_,index)=>index+1));const repeatCount=this.singleRow()?this.dataCount():this.gridColsInternal();setTimeout(()=>{element.style.display="grid",element.style.gap=`${gap}px`,element.style.gridTemplateColumns=`repeat(${repeatCount}, 1fr)`,this.applyStylesToChildren()},100)}}calculateGridSize(containerSize){const adjustedSize=containerSize/this.cols()-this.gap();return Math.ceil(adjustedSize)}applyStylesToChildren(){const element=this.imageContainer?.nativeElement;if(element){const width=this.calculateGridSize(element.offsetWidth??0),height=this.singleRow()?element.offsetHeight:this.calculateGridSize(element.offsetHeight??0),applyChildStyles=child=>{child.style.height=`${height}px`,child.style.width=`${width}px`};element.childNodes.forEach(child=>{child instanceof HTMLElement&&applyChildStyles(child)})}}fader(){this.hideDisplay.set(!0),setTimeout(()=>{this.hideDisplay.set(!1)},800)}scrollToChild(index){const containerElement=this.imageContainer?.nativeElement;if(!containerElement)return;const targetChild=containerElement.childNodes[index];if(!(targetChild instanceof HTMLElement))return;const scrollOffset=this.calculateScrollOffset(containerElement,targetChild);this.scroller?.nativeElement.scrollTo({left:scrollOffset,top:0})}calculateScrollOffset(container,child){return child.offsetLeft-container.offsetWidth/2+child.offsetWidth/2}useAction(index){this.action()&&this.imageSrc(index)&&(this.clickAreaExist()&&this.active()===index&&this.clickIndex.emit(index),this.currentIndex.emit(index),this.active.set(index),this.scrollToChild(index))}scale(index){const value=this.data()?.[index]?.src.scale;return`transform: scale(${value??1})`}imageSrc(index){return this.data()?.[index]?.src.default}imageAlt(index){return this.data()?.[index]?.alt}imageTitle(index){return this.data()?.[index]?.title}static ctorParameters=()=>[];static propDecorators={scrollerHeightValue:[{type:_debug_node_chunk.g$6,args:["style.height"]}],scroller:[{type:core.ViewChild,args:["scroller"]}],imageContainer:[{type:core.ViewChild,args:["imageContainer"]}],clickArea:[{type:core.ContentChild,args:[image_grid_click_area_directive.u,{read:_debug_node_chunk.C4Q,isSignal:!0}]}],data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}],debug:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"debug",required:!1,transform:void 0}]}],singleRow:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"singleRow",required:!1,transform:void 0}]}],gap:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"gap",required:!1,transform:void 0}]}],overlayType:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"overlayType",required:!1,transform:void 0}]}],cols:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"cols",required:!1,transform:void 0}]}],height:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"height",required:!1,transform:void 0}]}],action:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"action",required:!1,transform:void 0}]}],loaded:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"loaded",required:!1,transform:void 0}]}],setIndex:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"setIndex",required:!1,transform:void 0}]}],currentIndex:[{type:_debug_node_chunk.k7i,args:["currentIndex"]}],clickIndex:[{type:_debug_node_chunk.k7i,args:["clickIndex"]}]}};UiImageGridComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-image-grid",template:'@if (data()) {\n <div class="_scroller" #scroller>\n <div\n #imageContainer\n class="_image-container"\n [class._-hide-display]="hideDisplay()"\n >\n @for (item of dataCountItems(); track item; let i = $index) {\n <button\n class="_wrapper"\n [class._-action]="action() && imageSrc(i)"\n [class._-active]="active() === i"\n [class._-no-image]="!imageSrc(i)"\n [class]="overlayTypeClass()"\n (click)="useAction(i)"\n >\n @if (debug()) {\n dataCount: {{ this.dataCount() }} <br />\n internalCounter: {{ this.gridColsInternal() }} <br />\n counter: {{ this.cols() }} <br />\n src: {{ imageSrc(i) }}\n } @else {\n @if (imageSrc(i) && loaded()) {\n <figure>\n <img\n [style]="scale(i)"\n [src]="imageSrc(i)"\n [alt]="imageAlt(i)"\n [title]="imageTitle(i)"\n />\n </figure>\n @if (clickArea(); as template) {\n <div class="_click-area">\n <ng-container\n *ngTemplateOutlet="template; context: clickAreaContext(i)"\n ></ng-container>\n </div>\n }\n } @else {\n \x3c!-- No picture: the same shape the image editor uses — icon\n centred, whatever title the item carries underneath. No\n stand-in text: an empty title is the caller\'s business. --\x3e\n <div class="_empty">\n <span class="ui-icon x3" aria-hidden="true">image</span>\n <strong>{{ imageTitle(i) }}</strong>\n </div>\n }\n }\n </button>\n }\n </div>\n </div>\n}\n',imports:[_common_module_chunk.T3],styles:[image_grid_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiImageGridComponent)},"./libs/ui/.storybook/demos/examples/image-grid-slider/image-grid-slider.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ImageGallery:()=>ImageGallery,ImageGalleryZoom:()=>ImageGalleryZoom,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _storybook_angular__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),_src_lib_atoms_image_grid_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"),_src_lib_atoms_image_grid_image_grid_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts"),_src_lib_atoms_image_slider_image_slider_component__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./libs/ui/src/lib/atoms/image-slider/image-slider.component.ts"),_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image.mock.ts"),_header_header_component__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Examples/Image Gallery",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_0__.Iz)({imports:[_header_header_component__WEBPACK_IMPORTED_MODULE_5__.b,_src_lib_atoms_image_grid_image_grid_component__WEBPACK_IMPORTED_MODULE_2__.p,_src_lib_atoms_image_grid_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_1__.u,_src_lib_atoms_image_slider_image_slider_component__WEBPACK_IMPORTED_MODULE_3__.u]})]},ImageGallery={render:args=>({props:{...args,data:(0,_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__.W)(),currentIndex:0},template:'\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="flex flex-col">\n <ui-image-slider\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [zoom]="false">\n </ui-image-slider>\n <div class="relative h-[400px] mt-(--ui-spacer)">\n <ui-image-grid\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [action]="true"\n [loaded]="true"\n [height]="400"\n [cols]="3"\n [gap]="10">\n </ui-image-grid>\n </div>\n </section>\n '})},ImageGalleryZoom={render:args=>({props:{...args,data:(0,_src_lib_atoms_image_mock__WEBPACK_IMPORTED_MODULE_4__.W)(),index:0,zoom:!1},template:'\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [data]="data"\n [setIndex]="index"\n (clickIndex)="index=$event;zoom=true"\n [action]="true"\n [loaded]="true"\n overlayType="doors"\n [height]="480"\n [cols]="3"\n [gap]="10">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background p-2">{{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n @if(zoom) {\n <ui-image-slider\n [data]="data"\n [setIndex]="index"\n (currentIndex)="index=$event"\n (currentZoom)="zoom=$event"\n [zoom]="zoom"></ui-image-slider>\n }\n </section>\n '})},__namedExportsOrder=["ImageGallery","ImageGalleryZoom"];ImageGallery.parameters={...ImageGallery.parameters,docs:{...ImageGallery.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args,\n data: uiImageMock(),\n currentIndex: 0\n },\n template: `\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="flex flex-col">\n <ui-image-slider\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [zoom]="false">\n </ui-image-slider>\n <div class="relative h-[400px] mt-(--ui-spacer)">\n <ui-image-grid\n [data]="data"\n [setIndex]="currentIndex"\n (currentIndex)="currentIndex=$event"\n [action]="true"\n [loaded]="true"\n [height]="400"\n [cols]="3"\n [gap]="10">\n </ui-image-grid>\n </div>\n </section>\n `\n };\n }\n}',...ImageGallery.parameters?.docs?.source},description:{story:"Grid and slider side by side, sharing one index: a click in the grid moves\nthe slider, a step in the slider moves the grid's selection.",...ImageGallery.parameters?.docs?.description}}},ImageGalleryZoom.parameters={...ImageGalleryZoom.parameters,docs:{...ImageGalleryZoom.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args,\n data: uiImageMock(),\n index: 0,\n zoom: false\n },\n template: `\n <ui-intern-header theme="theme-light" display onTop></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [data]="data"\n [setIndex]="index"\n (clickIndex)="index=$event;zoom=true"\n [action]="true"\n [loaded]="true"\n overlayType="doors"\n [height]="480"\n [cols]="3"\n [gap]="10">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background p-2">{{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n @if(zoom) {\n <ui-image-slider\n [data]="data"\n [setIndex]="index"\n (currentIndex)="index=$event"\n (currentZoom)="zoom=$event"\n [zoom]="zoom"></ui-image-slider>\n }\n </section>\n `\n };\n }\n}',...ImageGalleryZoom.parameters?.docs?.source},description:{story:"The slider exists only while it is open. A click selects a tile; a click on\nthe selected tile's click area — the projected template, stamped per tile\nwith the tile's item — emits `clickIndex`, which creates the slider in zoom;\nthe slider's own close hands `currentZoom` back and removes it.",...ImageGalleryZoom.parameters?.docs?.description}}}},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n z-index: 0;\n --wrapper-height: 60rem;\n --button-size: 4rem;\n display: flex;\n /* Fills its container by default; the named hooks let a consumer set a fixed\n size without a cascade fight (tickets#241, tickets#251). */\n width: var(--ui-image-grid-width, 100%);\n height: var(--ui-image-grid-height, 100%);\n border-radius: calc(var(--ui-border-width) * 4);\n\n ._scroller {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n overflow-x: scroll;\n background-color: var(--ui-c-background);\n scroll-behavior: smooth;\n }\n\n ._image-container {\n position: absolute;\n top: 0;\n left: 0;\n display: grid;\n width: 100%;\n height: 100%;\n transition: opacity calc(var(--ui-time) * 0.1) linear;\n\n &._-hide-display {\n opacity: 0;\n }\n\n button._wrapper {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n gap: calc(var(--ui-spacer) * 0.5);\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: scale calc(var(--ui-time) * 0.5) ease-in-out;\n background-color: var(--ui-c-fourthly);\n border: 0;\n\n &._-no-image {\n cursor: default;\n opacity: 0.5;\n }\n\n /* The empty state, same arrangement as the image editor's: icon above,\n title below, both dimmed. */\n ._empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: calc(var(--ui-spacer) * 0.25);\n }\n\n &._-default {\n &:not(._-action) {\n cursor: default;\n }\n\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n }\n\n &._-doors {\n &._-active {\n border: 0.32rem solid var(--ui-c-focus);\n }\n\n &._-action:hover {\n img {\n transform: scale(1.1) !important;\n }\n }\n\n &::after,\n &::before {\n z-index: 1;\n content: '\\00a0';\n position: absolute;\n left: 0;\n display: flex;\n height: 100%;\n width: 100%;\n background-color: var(--ui-c-background);\n transition: var(--ui-time) ease-in-out;\n opacity: 0.6;\n }\n\n &::before {\n top: -50%;\n z-index: 1;\n }\n\n &::after {\n top: 50%;\n }\n\n &._-active::before {\n opacity: 0;\n top: -100%;\n }\n\n &._-active::after {\n opacity: 0;\n top: 100%;\n }\n }\n\n figure {\n position: relative;\n display: flex;\n flex-flow: column;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n img {\n width: auto;\n max-width: initial;\n aspect-ratio: auto;\n transition: transform calc(var(--ui-time) * 0.5) ease-in-out;\n -webkit-user-select: none;\n user-select: none;\n }\n }\n\n ._click-area {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: var(--ui-time) ease-in-out;\n }\n\n &._-active {\n ._click-area {\n opacity: 1;\n }\n }\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[365,1043],{"./libs/ui/.storybook/demos/header/header.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{b:()=>UiInternHeaderComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var header_componentngResource=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.css?ngResource"),header_componentngResource_default=__webpack_require__.n(header_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ui_config_types=__webpack_require__("./libs/ui/src/config/ui-config.types.ts"),layout_service=__webpack_require__("./libs/ui/src/lib/layout/_service/layout.service.ts");let UiInternHeaderComponent=class UiInternHeaderComponent{layoutService=(0,_effect_chunk2.WQX)(layout_service.u);theme=(0,core.input)(null);display=(0,core.input)(!1,{transform:core.booleanAttribute});onTop=(0,core.input)(!1,{transform:core.booleanAttribute});ngOnInit(){this.layoutService.handleTheme(this.theme(),ui_config_types.Q)}ngOnDestroy(){this.layoutService.handleTheme("theme-light",ui_config_types.Q)}setTheme(){this.layoutService.handleTheme(null,ui_config_types.Q)}static propDecorators={theme:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"theme",required:!1,transform:void 0}]}],display:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"display",required:!1,transform:void 0}]}],onTop:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"onTop",required:!1,transform:void 0}]}]}};UiInternHeaderComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-intern-header",template:'@if (display()) {\n <button class="ui" [class._on-top]="onTop()" (click)="setTheme()">\n switch Theme\n </button>\n}\n',encapsulation:_debug_node_chunk.gXe.Emulated,standalone:!0,imports:[_common_module_chunk.MD],styles:[header_componentngResource_default()]})],UiInternHeaderComponent)},"./libs/ui/src/config/ui-config.types.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Q:()=>uiConfigStorybookCssPrefix,y:()=>uiConfigTypes});const uiConfigStorybookCssPrefix="ui-storybook ",uiConfigTypes={mainID:"ui-main",mainClass:"ui-main",storeName:"ui-layout"}},"./libs/ui/src/lib/layout/_service/layout.service.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiLayoutService});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@ngx-pwa/local-storage/fesm2022/ngx-pwa-local-storage.mjs"),_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/config/ui-config.types.ts");let UiLayoutService=class UiLayoutService{storage=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__.AX);settings={cssPrefix:"",theme:null,zoom:null,fullscreen:null,direction:"center",layoutSize:null};setStorage(){this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}handleInit(config){this.settings.cssPrefix=config.cssPrefix,this.settings.theme=config.theme,this.settings.zoom=config.zoom?"zoom":"x-zoom",this.settings.fullscreen=config.fullscreen?"fullscreen":"x-fullscreen",this.handleFullScreen(this.settings.fullscreen),this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data),this.setStorage(),this.setTheme(null)})}setTheme(theme){document.body.className=theme?`${this.settings.cssPrefix} ${theme}`:`${this.settings.cssPrefix} ${this.settings.theme}`}getTheme(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.theme}getMainClass(){return`${_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.mainClass} ${this.settings.zoom} ${this.settings.fullscreen}`}handleFullScreen(init){init?this.settings.fullscreen=init:"fullscreen"===this.settings.fullscreen?this.settings.fullscreen="x-fullscreen":this.settings.fullscreen="fullscreen",this.setStorage()}handleZoom(init){init?this.settings.zoom=init:"zoom"===this.settings.zoom?this.settings.zoom="x-zoom":this.settings.zoom="zoom",this.setStorage()}handleTheme(theme,prefix){return prefix&&(this.settings.cssPrefix=prefix),theme?(this.setTheme(theme),this.settings.theme=theme):(this.settings.theme="theme-light"===this.settings.theme?"theme-dark":"theme-light",this.setTheme(null)),this.setStorage(),this.settings.theme}handleDirection(type){this.settings.direction=type,this.setStorage()}setLayoutSize(sizes){this.settings.layoutSize=sizes,this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}getLayoutSize(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.layoutSize}};UiLayoutService=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__._qm)({providedIn:"root"})],UiLayoutService)},"./libs/ui/.storybook/blocks/guide.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Ay:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_guide_entries__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/blocks/guide.entries.js"),_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.model.mjs");const Link=({href,children})=>href?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.zE,{href,children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children}),Sentences=({items})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul",{children:items.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li",{children:s},i))}),Block=({of,entry})=>{const m=(0,_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__.Cc)(entry,_guide_entries__WEBPACK_IMPORTED_MODULE_4__.H,of);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section",{className:"ui-guide",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("h4",{children:["Guide — a recommendation, not the truth",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[" · reviewed ",m.reviewed]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:["Written by an agent from the sources below, only for what runs in the house."," ","component"===m.kind?"The section above is what the component does; this is what to reach for it for.":"The pages of the parts say what each does; this is what they are for together."," ","Where the two disagree, the page wins."]}),m.uses.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Builds on"})," ",m.uses.map((u,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:u.href,children:u.selector})]},u.selector))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Use it for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.useFor}),m.notFor.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Not for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.notFor})]}),m.instead.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Instead"})," ",m.instead.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.selector})]},s.selector))]}),m.note&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Note"})," ",m.note]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Shown in"})," ",m.shownIn.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&" · ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.label})]},s.label))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Sources"})," ",m.sources.join(" · ")]})})]})};function _createMdxContent(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:["\n","\n","\n","\n","\n","\n","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Block,{of:props.of,entry:props.entry})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/layout/spinner/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_spinner_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/layout/spinner/spinner.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_layout_spinner_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-layout-spinner.json");function _createMdxContent(props){const _components={a:"a",code:"code",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_spinner_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"layout-spinner",children:"Layout: Spinner"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A global loading indicator that provides visual feedback during asynchronous operations."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"what-it-does-and-what-it-does-not",children:"What it does, and what it does not"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["A global loading indicator, placed once at the application root and switched\nthrough ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiLayoutSpinnerService"})," from anywhere — an HTTP interceptor, typically.\nIt shows, animates out and hides; it does not count requests, time out or block\ninput on its own, and it is not the spinner for one component's own loading\nstate."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"ui-layout-spinner",entry:_guide_ui_layout_spinner_json__WEBPACK_IMPORTED_MODULE_6__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"overview",children:"Overview"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiLayoutSpinnerComponent"})," is a singleton component typically placed at the application root (e.g., ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"app.component.html"}),"). It's controlled via the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiLayoutSpinnerService"}),", making it easy to trigger from anywhere in the app, such as an HTTP interceptor."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"example-spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/layout-spinner--spinner",children:"Example: Spinner"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"arguments-props",children:"Arguments (Props)"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"inputs",children:"Inputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"@Input"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tbody",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"debug"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"boolean"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"false"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"true"}),", displays a debug navigation to manually test spinner states."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"close"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"boolean"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"false"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"true"}),", shows a close button to manually dismiss the spinner."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"type"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'ring' | 'linear' | 'disco'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'ring'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Selects the loading animation: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"ring"})," (rotating gradient ring), ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"linear"})," (indeterminate sliding bar), or ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"disco"})," (spinning rainbow ring with hue rotation and a blinking sparkle in the centre)."]})]})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.h3,{id:"service-uilayoutspinnerservice",children:["Service: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiLayoutSpinnerService"})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Use this service to control the spinner's state:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-typescript",children:"// Start the spinner\nspinnerService.startSpinner();\n\n// Mark operation as successful (animates out and hides). A visible\n// message state is NOT auto-dismissed by this call.\nspinnerService.successSpinner();\n\n// Show a message within the spinner (stays until dismissed)\nspinnerService.messageSpinner('Loading your data...');\n\n// Dismiss unconditionally — also clears a message state (used by the\n// overlay's OK button when [close] is enabled)\nspinnerService.dismissSpinner();\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Usage: Add to Template"})," Place the component in your main application template."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-layout-spinner [close]="true" [debug]="true"></ui-layout-spinner>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/layout/spinner/spinner.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Spinner:()=>Spinner,__namedExportsOrder:()=>__namedExportsOrder,default:()=>spinner_component_stories});var fesm2022_forms=__webpack_require__("./node_modules/@angular/forms/fesm2022/forms.mjs"),dist=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),header_component=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var spinner_componentngResource=__webpack_require__("./libs/ui/src/lib/layout/spinner/spinner.component.css?ngResource"),spinner_componentngResource_default=__webpack_require__.n(spinner_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),Subscription=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/Subscription.js"),BehaviorSubject=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js");let UiLayoutSpinnerService=class UiLayoutSpinnerService{status=new BehaviorSubject.t({show:"none"});hideTimeout=null;startSpinner(){this.cancelPendingHide(),this.status.next({show:"showIn"})}messageSpinner(content){this.cancelPendingHide(),this.status.next({content,show:"error"})}successSpinner(){this.status.getValue().content||this.dismissSpinner()}dismissSpinner(){this.cancelPendingHide(),this.status.next({show:"showOut"}),this.hideTimeout=setTimeout(()=>{this.hideTimeout=null,this.status.next({show:"none"})},1200)}cancelPendingHide(){null!==this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}getSpinner(){return this.status}};UiLayoutSpinnerService=(0,tslib_es6.Cg)([(0,_debug_node_chunk._qm)({providedIn:"root"})],UiLayoutSpinnerService);let UiLayoutSpinnerComponent=class UiLayoutSpinnerComponent{spinnerService=(0,_effect_chunk2.WQX)(UiLayoutSpinnerService);debug=(0,core.input)(!1);close=(0,core.input)(!1);type=(0,core.input)("ring");status=(0,_effect_chunk2.vPA)({show:"none"});subscription=new Subscription.yU;ngOnInit(){this.subscription.add(this.spinnerService.getSpinner().subscribe(show=>this.status.set(show)))}ngOnDestroy(){this.subscription.unsubscribe()}static propDecorators={debug:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"debug",required:!1,transform:void 0}]}],close:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"close",required:!1,transform:void 0}]}],type:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"type",required:!1,transform:void 0}]}]}};UiLayoutSpinnerComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-layout-spinner",template:'@if (debug()) {\n <div class="ui-debug">\n <button class="ui" (click)="spinnerService.startSpinner()">Start</button>\n <button class="ui" (click)="spinnerService.successSpinner()">Success</button>\n <button class="ui" (click)="spinnerService.messageSpinner(\'Info message\')">Message</button>\n <span>\n {{ status() | json }}\n </span>\n </div>\n}\n\n@if (status().show !== \'none\') {\n <div class="_spinner" [class]="status().show">\n <div class="_loader" [class]="\'_-\' + type()" aria-hidden="true"></div>\n @if (type() === \'disco\') {\n <div class="_disco-blink" aria-hidden="true"></div>\n }\n @if (status().content) {\n <div class="_content">\n <span [innerHTML]="status().content"></span>\n @if (close()) {\n <div class="_actions">\n <button class="ui" (click)="spinnerService.dismissSpinner()">OK</button>\n </div>\n }\n </div>\n }\n </div>\n}\n',imports:[_common_module_chunk.TG],styles:[spinner_componentngResource_default()]})],UiLayoutSpinnerComponent);const spinner_component_stories={title:"Layout/Spinner",decorators:[(0,dist.Iz)({providers:[],imports:[header_component.b,fesm2022_forms.YN,UiLayoutSpinnerComponent]})],argTypes:{debug:{control:"boolean"},close:{control:"boolean"},type:{control:"select",options:["ring","linear","disco"]}},args:{debug:!0,close:!0,type:"ring"}},Spinner={args:{debug:!0,close:!0,type:"ring"},render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <ui-layout-spinner [close]="close" [debug]="debug" [type]="type"></ui-layout-spinner>\n '})},__namedExportsOrder=["Spinner"];Spinner.parameters={...Spinner.parameters,docs:{...Spinner.parameters?.docs,source:{originalSource:'{\n args: {\n debug: true,\n close: true,\n type: \'ring\'\n },\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <ui-layout-spinner [close]="close" [debug]="debug" [type]="type"></ui-layout-spinner>\n `\n };\n }\n}',...Spinner.parameters?.docs?.source}}}},"./libs/ui/.storybook/demos/header/header.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"/* The intern header is reduced to just the theme switch button, pinned to the */\n/* bottom-left corner of the Storybook canvas. */\nbutton {\n position: fixed;\n bottom: calc(var(--ui-spacer) * 0.5);\n left: calc(var(--ui-spacer) * 0.5);\n z-index: 1000;\n\n &._on-top {\n z-index: 10000;\n }\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/layout/spinner/spinner.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n@keyframes pie-show-in {\n 0% {\n opacity: 0;\n }\n 10% {\n opacity: 1;\n }\n}\n\n@keyframes pie-show-out {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes ring-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes linear-slide {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(250%);\n }\n}\n\n@keyframes disco-hue {\n to {\n filter: hue-rotate(360deg);\n }\n}\n\n@keyframes disco-blink {\n 0%,\n 40% {\n opacity: 1;\n transform: scale(1);\n }\n 50%,\n 90% {\n opacity: 0.15;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes disco-party {\n 0% {\n background: #ff2d95;\n box-shadow: 0 0 2rem 0.6rem #ff2d95;\n }\n 16% {\n background: #ff9500;\n box-shadow: 0 0 2rem 0.6rem #ff9500;\n }\n 33% {\n background: #ffe600;\n box-shadow: 0 0 2rem 0.6rem #ffe600;\n }\n 50% {\n background: #33dd55;\n box-shadow: 0 0 2rem 0.6rem #33dd55;\n }\n 66% {\n background: #00c8ff;\n box-shadow: 0 0 2rem 0.6rem #00c8ff;\n }\n 83% {\n background: #cc44ff;\n box-shadow: 0 0 2rem 0.6rem #cc44ff;\n }\n 100% {\n background: #ff2d95;\n box-shadow: 0 0 2rem 0.6rem #ff2d95;\n }\n}\n\n/* ---------------------------------------------------------------------------- */\n/* Defaut */\n/* ---------------------------------------------------------------------------- */\n\n._spinner {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(var(--ui-c-background-value), 0.6);\n z-index: 1000;\n\n &._debug {\n position: absolute;\n }\n\n &.showIn {\n animation-name: pie-show-in;\n animation-duration: calc(0.6s * 2.25);\n animation-fill-mode: forwards;\n animation-timing-function: linear;\n /*z-index: 1000;*/\n }\n\n &.showOut {\n animation-name: pie-show-out;\n animation-duration: calc(0.6s * 2.25);\n animation-fill-mode: forwards;\n animation-timing-function: linear;\n }\n\n /* Loading indicator. The visual is selected via the `type` input, which\n adds one of the `_-ring` / `_-linear` / `_-disco` modifiers. */\n ._loader {\n position: absolute;\n }\n\n /* ring — a conic-gradient comet tail masked into an annulus (hollow\n centre) that rotates seamlessly. */\n ._loader._-ring {\n width: 26rem;\n height: 26rem;\n border-radius: 50%;\n background: conic-gradient(\n from 0deg,\n rgba(var(--ui-c-fourthly-value), 0) 0deg,\n rgba(var(--ui-c-fourthly-value), 0.15) 90deg,\n var(--ui-c-fourthly) 360deg\n );\n -webkit-mask: radial-gradient(\n farthest-side,\n transparent calc(100% - 2rem),\n #000 calc(100% - 2rem)\n );\n mask: radial-gradient(\n farthest-side,\n transparent calc(100% - 2rem),\n #000 calc(100% - 2rem)\n );\n animation: ring-spin 1.2s linear infinite;\n }\n\n /* linear — an indeterminate horizontal bar with a segment sliding across a\n faint track. */\n ._loader._-linear {\n width: 26rem;\n height: 0.6rem;\n border-radius: 999px;\n background: rgba(var(--ui-c-fourthly-value), 0.15);\n overflow: hidden;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n width: 40%;\n border-radius: inherit;\n background: var(--ui-c-fourthly);\n animation: linear-slide 1.2s ease-in-out infinite;\n }\n }\n\n /* disco — a full rainbow ring that spins while its hue rotates. */\n ._loader._-disco {\n width: 26rem;\n height: 26rem;\n border-radius: 50%;\n background: conic-gradient(\n from 0deg,\n #ff0040,\n #ff9500,\n #ffe600,\n #33dd55,\n #00c8ff,\n #4455ff,\n #cc44ff,\n #ff0040\n );\n -webkit-mask: radial-gradient(\n farthest-side,\n transparent calc(100% - 2.4rem),\n #000 calc(100% - 2.4rem)\n );\n mask: radial-gradient(\n farthest-side,\n transparent calc(100% - 2.4rem),\n #000 calc(100% - 2.4rem)\n );\n animation:\n ring-spin 1s linear infinite,\n disco-hue 3s linear infinite;\n }\n\n /* disco centre sparkle — a big glowing dot blinking on/off in the hollow\n ring centre while cycling through party colours. */\n ._disco-blink {\n position: absolute;\n width: 5rem;\n height: 5rem;\n border-radius: 50%;\n animation:\n disco-blink 0.5s ease-in-out infinite,\n disco-party 1.5s linear infinite;\n }\n\n ._content {\n z-index: 1001;\n display: flex;\n flex-flow: column;\n gap: calc(var(--ui-spacer) * 0.5);\n max-width: 80%;\n background-color: var(--ui-c-background);\n padding: calc(var(--ui-spacer) * 0.25);\n border-radius: var(--ui-border-radius);\n border:1px solid var(--ui-c-default);\n ._message {\n display: flex;\n justify-content: flex-end;\n }\n ._actions {\n padding-top: calc(var(--ui-spacer) * 0.5);\n border-top: var(--ui-border-width) solid var(--ui-c-default);\n display: flex;\n justify-content: flex-end;\n }\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n ._spinner ._loader._-ring,\n ._spinner ._loader._-disco {\n animation-duration: 2s;\n }\n ._spinner ._loader._-linear::before {\n animation-duration: 2s;\n }\n ._spinner ._disco-blink {\n animation-duration: 2s, 6s;\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|