@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
|
@@ -0,0 +1 @@
|
|
|
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:["The same rule, turned inward: the library's own sheet sets ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"strong"})," like a\nfourth heading — its size, its line height, the default colour — which is\nright for the house's surfaces and would be wrong here. A ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"**word**"})," in the\nmiddle of a sentence is a bold word, not a subheading, so the reader takes\nthe three back and leaves only the weight. The rule is pinned by a test\nagainst the stylesheet."]}),"\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__.Emphasis}),"\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)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
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,Emphasis:()=>Emphasis,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},Emphasis={parameters:noControls,args:{...base,markdown:"# Demo document\n\nA paragraph with a **strong** word and an *emphasised* one keeps its line: the\nbold word stays the paragraph's size, line height and colour. Only its weight\nchanges — the library's own rule that sets `strong` like a fourth heading\ndoes not reach into a document.\n\n**A whole sentence in bold is still a sentence**, not a heading. A heading is\nwritten as one.\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","Emphasis","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}}},Emphasis.parameters={...Emphasis.parameters,docs:{...Emphasis.parameters?.docs,source:{originalSource:"{\n parameters: noControls,\n args: {\n ...base,\n markdown: WITH_EMPHASIS\n },\n render\n}",...Emphasis.parameters?.docs?.source},description:{story:"Emphasis stays in the line. The house sheet sets `strong` like a fourth\nheading — the reader takes size, line height and colour back, so a bold\nword mid-sentence is a bold word and not a blue subheading.",...Emphasis.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 /* Emphasis stays in the line. The library's own sheet sets `strong` like a\n fourth heading — its size, its line height, the default colour — which is\n right for the house's surfaces and wrong for a foreign paragraph: a\n `**word**` mid-sentence became a blue subheading. This layer sits above\n `ui.base`, so the reader takes the three back here. Weight is the\n browser's own bold, untouched. */\n ._doc strong {\n font-size: inherit;\n line-height: inherit;\n color: inherit;\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 +1 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3925,5370],{"./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/atoms/thumb/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"),_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_thumb_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-thumb.json");function _createMdxContent(props){const _components={code:"code",h3:"h3",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:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"thumb",children:"Thumb"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A component for displaying thumbnail images with optional links and titles."}),"\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:["Shows one thumbnail from a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiThumbType"}),": the picture (with an optional WebP\nsource), its alt text, an optional caption from ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"}),", and a link around it —\nan external ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"})," or an in-app ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," with a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"}),". It takes\nthe width it is given and draws nothing else: no gallery, no lazy loading of its\nown, no decision about which picture to show."]}),"\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-thumb",entry:_guide_ui_thumb_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:"UiThumbComponent"})," is used to show image previews (thumbnails). It supports standard image formats as well as WebP, and can wrap the thumbnail in a link with a title and target attribute. For in-app navigation the thumbnail can render a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," anchor with an optional URL ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"})," instead of a plain external link."]}),"\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__.jsx)(_components.p,{children:"The following properties can be used to configure the thumbnail:"}),"\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.code,{children:"data"}),": (Input) An object of type ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiThumbType"})," containing the image source, alt text, link, and other metadata."]}),"\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:"basic-example",children:"Basic Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"In this example, you can see how the thumbnail is rendered using mock data."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__.Thumb}),"\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:"internal-link-example",children:"Internal Link Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["When ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," is set, the thumbnail navigates within the app (SPA navigation, no page reload) and appends the optional ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"})," to the URL. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," takes precedence over ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__.ThumbInternalLink}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Usage"})}),"\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-thumb [data]="thumbData"></ui-thumb>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The tag is a block of its own and takes the width it is given — place it in\na grid cell or give it a width, nothing more is needed."}),"\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:"types-uithumbtype",children:"Types: UiThumbType"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The data object structure:"}),"\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:"interface UiThumbType {\n link: string | null;\n title: string | null;\n target: string | null;\n src: string | null;\n srcWebp: string | null;\n alt: string;\n routerLink?: string | null;\n fragment?: string | null;\n}\n"})}),"\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.code,{children:"routerLink"}),": in-app route for SPA navigation; takes precedence over ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"}),": URL fragment appended to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"}),", e.g. an anchor element id."]}),"\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:"css-custom-properties",children:"CSS Custom Properties"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The image zoom is configurable per consumer by setting these custom properties on the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-thumb"})," host element:"]}),"\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:"Property"}),(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:"--ui-thumb-scale"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"1"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Base zoom of the thumbnail image."})]}),(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:"--ui-thumb-scale-hover"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"1.4"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Zoom of the thumbnail image on hover."})]})]})]}),"\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-css",children:"ui-thumb {\n --ui-thumb-scale: 1.4;\n --ui-thumb-scale-hover: 1.6;\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/src/lib/atoms/thumb/thumb.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Thumb:()=>Thumb,ThumbInternalLink:()=>ThumbInternalLink,ThumbTheme:()=>ThumbTheme,__namedExportsOrder:()=>__namedExportsOrder,default:()=>thumb_component_stories});var _router_module_chunk=__webpack_require__("./node_modules/@angular/router/fesm2022/_router_module-chunk.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 thumb_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.css?ngResource"),thumb_componentngResource_default=__webpack_require__.n(thumb_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");let UiThumbComponent=class UiThumbComponent{data=(0,core.input)(null);static propDecorators={data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}]}};UiThumbComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-thumb",template:'@if (data()) {\n @if (data()!.routerLink) {\n <a\n [routerLink]="data()!.routerLink"\n [fragment]="data()!.fragment || undefined"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n } @else {\n <a\n [attr.href]="data()!.link || null"\n [attr.target]="data()!.target || null"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n }\n}\n\n<ng-template #figure>\n <figure>\n @if (data()!.title) {\n <figcaption>\n <span class="ui-ellipsis"> {{ data()!.title }}</span>\n </figcaption>\n }\n <picture>\n @if (data()!.srcWebp) {\n <source\n [srcset]="data()!.srcWebp"\n type="image/webp"\n />\n }\n <img [src]="data()!.src" [alt]="data()!.alt" />\n </picture>\n </figure>\n</ng-template>\n',encapsulation:_debug_node_chunk.gXe.Emulated,imports:[_common_module_chunk.T3,_router_module_chunk.Wk],styles:[thumb_componentngResource_default()]})],UiThumbComponent);const thumb_component_stories={title:"Atoms/Thumb",component:UiThumbComponent,decorators:[(0,dist.L4)({providers:[(0,_router_module_chunk.lh)([{path:"**",children:[]}])]}),(0,dist.Iz)({imports:[header_component.b,UiThumbComponent]})],argTypes:{data:{control:"object"}},args:{data:{link:"#",title:"thumb-title",target:"_blank",src:"https://moja.work/media/pictures/numbers/10/numbers-001.png",srcWebp:null,alt:"thumb alt"}},parameters:{docs:{canvas:{sourceState:"none"}}}},Thumb={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbInternalLink={args:{data:{link:null,title:"thumb-internal-title",target:null,src:"https://moja.work/media/pictures/numbers/10/numbers-002.png",srcWebp:null,alt:"thumb alt",routerLink:"/target-page",fragment:"anchor-id",routerLink:".",fragment:"demo"}},render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbTheme={render:args=>({props:{...args},template:'\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},__namedExportsOrder=["Thumb","ThumbInternalLink","ThumbTheme"];Thumb.parameters={...Thumb.parameters,docs:{...Thumb.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...Thumb.parameters?.docs?.source}}},ThumbInternalLink.parameters={...ThumbInternalLink.parameters,docs:{...ThumbInternalLink.parameters?.docs,source:{originalSource:'{\n args: {\n // Neutralized navigation: story links must never leave Storybook, so\n // the routerLink points at the current route (fragment only).\n data: {\n ...uiAtomThumbInternalMock,\n routerLink: \'.\',\n fragment: \'demo\'\n }\n },\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbInternalLink.parameters?.docs?.source}}},ThumbTheme.parameters={...ThumbTheme.parameters,docs:{...ThumbTheme.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbTheme.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/atoms/thumb/thumb.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 /* A box of its own. Every consumer used to declare `display: flex` on the\n tag itself before the thumb would take a width; that is the library's\n job, not three copies of the same rule in three apps. */\n display: block;\n\n a {\n display: flex;\n width: calc(100% - var(--ui-border-width) * 2);\n background-color: var(--ui-c-fourthly);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n overflow: hidden;\n }\n\n figure {\n position: relative;\n display: flex;\n width: 100%;\n margin: 0;\n\n z-index: 0;\n img {\n width: 100%;\n }\n figcaption {\n position: absolute;\n left: 0;\n bottom: 0;\n display: flex;\n width: 100%;\n height: fit-content;\n border: 0;\n color: var(--ui-c-default);\n background-color: rgba(var(--ui-c-background-value), 0.6);\n padding: calc(var(--ui-spacer) * 0.125);\n z-index: 1;\n }\n /* Zoom levels are consumer-configurable via the --ui-thumb-scale(-hover)\n custom properties (set them on the ui-thumb host element). */\n picture {\n transition: transform var(--ui-time);\n transform: scale(var(--ui-thumb-scale, 1));\n }\n picture:hover {\n transform: scale(var(--ui-thumb-scale-hover, 1.4));\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
1
|
+
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3925,5370],{"./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/atoms/thumb/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"),_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_thumb_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-thumb.json");function _createMdxContent(props){const _components={code:"code",h3:"h3",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:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"thumb",children:"Thumb"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A component for displaying thumbnail images with optional links and titles."}),"\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:["Shows one thumbnail from a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiThumbType"}),": the picture (with an optional WebP\nsource), its alt text, an optional caption from ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"}),", and a link around it —\nan external ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"})," or an in-app ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," with a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"}),". It takes\nthe width it is given and draws nothing else: no gallery, no lazy loading of its\nown, no decision about which picture to show."]}),"\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-thumb",entry:_guide_ui_thumb_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:"UiThumbComponent"})," is used to show image previews (thumbnails). It supports standard image formats as well as WebP, and can wrap the thumbnail in a link with a title and target attribute. For in-app navigation the thumbnail can render a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," anchor with an optional URL ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"})," instead of a plain external link."]}),"\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__.jsx)(_components.p,{children:"The following properties can be used to configure the thumbnail:"}),"\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.code,{children:"data"}),": (Input) An object of type ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiThumbType"})," containing the image source, alt text, link, and other metadata."]}),"\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:"basic-example",children:"Basic Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"In this example, you can see how the thumbnail is rendered using mock data."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__.Thumb}),"\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:"internal-link-example",children:"Internal Link Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["When ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," is set, the thumbnail navigates within the app (SPA navigation, no page reload) and appends the optional ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"})," to the URL. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"})," takes precedence over ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_thumb_component_stories__WEBPACK_IMPORTED_MODULE_4__.ThumbInternalLink}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Usage"})}),"\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-thumb [data]="thumbData"></ui-thumb>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The tag is a block of its own and takes the width it is given — place it in\na grid cell or give it a width, nothing more is needed."}),"\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:"types-uithumbtype",children:"Types: UiThumbType"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The data object structure:"}),"\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:"interface UiThumbType {\n link: string | null;\n title: string | null;\n target: string | null;\n src: string | null;\n srcWebp: string | null;\n alt: string;\n routerLink?: string | null;\n fragment?: string | null;\n}\n"})}),"\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.code,{children:"routerLink"}),": in-app route for SPA navigation; takes precedence over ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"link"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"target"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"fragment"}),": URL fragment appended to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"routerLink"}),", e.g. an anchor element id."]}),"\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:"css-custom-properties",children:"CSS Custom Properties"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The image zoom is configurable per consumer by setting these custom properties on the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-thumb"})," host element:"]}),"\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:"Property"}),(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:"--ui-thumb-scale"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"1"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Base zoom of the thumbnail image."})]}),(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:"--ui-thumb-scale-hover"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"1.4"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Zoom of the thumbnail image on hover."})]})]})]}),"\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-css",children:"ui-thumb {\n --ui-thumb-scale: 1.4;\n --ui-thumb-scale-hover: 1.6;\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/src/lib/atoms/thumb/thumb.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Thumb:()=>Thumb,ThumbInternalLink:()=>ThumbInternalLink,ThumbTheme:()=>ThumbTheme,__namedExportsOrder:()=>__namedExportsOrder,default:()=>thumb_component_stories});var _router_module_chunk=__webpack_require__("./node_modules/@angular/router/fesm2022/_router_module-chunk.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 thumb_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.css?ngResource"),thumb_componentngResource_default=__webpack_require__.n(thumb_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");let UiThumbComponent=class UiThumbComponent{data=(0,core.input)(null);static propDecorators={data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}]}};UiThumbComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-thumb",template:'@if (data()) {\n @if (data()!.routerLink) {\n <a\n [routerLink]="data()!.routerLink"\n [fragment]="data()!.fragment || undefined"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n } @else {\n <a\n [attr.href]="data()!.link || null"\n [attr.target]="data()!.target || null"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n }\n}\n\n<ng-template #figure>\n <figure>\n @if (data()!.title) {\n <figcaption>\n <span class="ui-ellipsis"> {{ data()!.title }}</span>\n </figcaption>\n }\n <picture>\n @if (data()!.srcWebp) {\n <source\n [srcset]="data()!.srcWebp"\n type="image/webp"\n />\n }\n <img [src]="data()!.src" [alt]="data()!.alt" />\n </picture>\n </figure>\n</ng-template>\n',encapsulation:_debug_node_chunk.gXe.Emulated,imports:[_common_module_chunk.T3,_router_module_chunk.Wk],styles:[thumb_componentngResource_default()]})],UiThumbComponent);const thumb_component_stories={title:"Atoms/Thumb",component:UiThumbComponent,decorators:[(0,dist.L4)({providers:[(0,_router_module_chunk.lh)([{path:"**",children:[]}])]}),(0,dist.Iz)({imports:[header_component.b,UiThumbComponent]})],argTypes:{data:{control:"object"}},args:{data:{link:"#",title:"thumb-title",target:"_blank",src:"https://moja.work/content/_assets/pictures/numbers/10/numbers-001.png",srcWebp:null,alt:"thumb alt"}},parameters:{docs:{canvas:{sourceState:"none"}}}},Thumb={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbInternalLink={args:{data:{link:null,title:"thumb-internal-title",target:null,src:"https://moja.work/content/_assets/pictures/numbers/10/numbers-002.png",srcWebp:null,alt:"thumb alt",routerLink:"/target-page",fragment:"anchor-id",routerLink:".",fragment:"demo"}},render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbTheme={render:args=>({props:{...args},template:'\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},__namedExportsOrder=["Thumb","ThumbInternalLink","ThumbTheme"];Thumb.parameters={...Thumb.parameters,docs:{...Thumb.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...Thumb.parameters?.docs?.source}}},ThumbInternalLink.parameters={...ThumbInternalLink.parameters,docs:{...ThumbInternalLink.parameters?.docs,source:{originalSource:'{\n args: {\n // Neutralized navigation: story links must never leave Storybook, so\n // the routerLink points at the current route (fragment only).\n data: {\n ...uiAtomThumbInternalMock,\n routerLink: \'.\',\n fragment: \'demo\'\n }\n },\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbInternalLink.parameters?.docs?.source}}},ThumbTheme.parameters={...ThumbTheme.parameters,docs:{...ThumbTheme.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbTheme.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/atoms/thumb/thumb.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 /* A box of its own. Every consumer used to declare `display: flex` on the\n tag itself before the thumb would take a width; that is the library's\n job, not three copies of the same rule in three apps. */\n display: block;\n\n a {\n display: flex;\n width: calc(100% - var(--ui-border-width) * 2);\n background-color: var(--ui-c-fourthly);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n overflow: hidden;\n }\n\n figure {\n position: relative;\n display: flex;\n width: 100%;\n margin: 0;\n\n z-index: 0;\n img {\n width: 100%;\n }\n figcaption {\n position: absolute;\n left: 0;\n bottom: 0;\n display: flex;\n width: 100%;\n height: fit-content;\n border: 0;\n color: var(--ui-c-default);\n background-color: rgba(var(--ui-c-background-value), 0.6);\n padding: calc(var(--ui-spacer) * 0.125);\n z-index: 1;\n }\n /* Zoom levels are consumer-configurable via the --ui-thumb-scale(-hover)\n custom properties (set them on the ui-thumb host element). */\n picture {\n transition: transform var(--ui-time);\n transform: scale(var(--ui-thumb-scale, 1));\n }\n picture:hover {\n transform: scale(var(--ui-thumb-scale-hover, 1.4));\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3925],{"./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/src/lib/atoms/thumb/thumb.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Thumb:()=>Thumb,ThumbInternalLink:()=>ThumbInternalLink,ThumbTheme:()=>ThumbTheme,__namedExportsOrder:()=>__namedExportsOrder,default:()=>thumb_component_stories});var _router_module_chunk=__webpack_require__("./node_modules/@angular/router/fesm2022/_router_module-chunk.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 thumb_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.css?ngResource"),thumb_componentngResource_default=__webpack_require__.n(thumb_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");let UiThumbComponent=class UiThumbComponent{data=(0,core.input)(null);static propDecorators={data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}]}};UiThumbComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-thumb",template:'@if (data()) {\n @if (data()!.routerLink) {\n <a\n [routerLink]="data()!.routerLink"\n [fragment]="data()!.fragment || undefined"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n } @else {\n <a\n [attr.href]="data()!.link || null"\n [attr.target]="data()!.target || null"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n }\n}\n\n<ng-template #figure>\n <figure>\n @if (data()!.title) {\n <figcaption>\n <span class="ui-ellipsis"> {{ data()!.title }}</span>\n </figcaption>\n }\n <picture>\n @if (data()!.srcWebp) {\n <source\n [srcset]="data()!.srcWebp"\n type="image/webp"\n />\n }\n <img [src]="data()!.src" [alt]="data()!.alt" />\n </picture>\n </figure>\n</ng-template>\n',encapsulation:_debug_node_chunk.gXe.Emulated,imports:[_common_module_chunk.T3,_router_module_chunk.Wk],styles:[thumb_componentngResource_default()]})],UiThumbComponent);const thumb_component_stories={title:"Atoms/Thumb",component:UiThumbComponent,decorators:[(0,dist.L4)({providers:[(0,_router_module_chunk.lh)([{path:"**",children:[]}])]}),(0,dist.Iz)({imports:[header_component.b,UiThumbComponent]})],argTypes:{data:{control:"object"}},args:{data:{link:"#",title:"thumb-title",target:"_blank",src:"https://moja.work/media/pictures/numbers/10/numbers-001.png",srcWebp:null,alt:"thumb alt"}},parameters:{docs:{canvas:{sourceState:"none"}}}},Thumb={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbInternalLink={args:{data:{link:null,title:"thumb-internal-title",target:null,src:"https://moja.work/media/pictures/numbers/10/numbers-002.png",srcWebp:null,alt:"thumb alt",routerLink:"/target-page",fragment:"anchor-id",routerLink:".",fragment:"demo"}},render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbTheme={render:args=>({props:{...args},template:'\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},__namedExportsOrder=["Thumb","ThumbInternalLink","ThumbTheme"];Thumb.parameters={...Thumb.parameters,docs:{...Thumb.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...Thumb.parameters?.docs?.source}}},ThumbInternalLink.parameters={...ThumbInternalLink.parameters,docs:{...ThumbInternalLink.parameters?.docs,source:{originalSource:'{\n args: {\n // Neutralized navigation: story links must never leave Storybook, so\n // the routerLink points at the current route (fragment only).\n data: {\n ...uiAtomThumbInternalMock,\n routerLink: \'.\',\n fragment: \'demo\'\n }\n },\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbInternalLink.parameters?.docs?.source}}},ThumbTheme.parameters={...ThumbTheme.parameters,docs:{...ThumbTheme.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbTheme.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/atoms/thumb/thumb.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 /* A box of its own. Every consumer used to declare `display: flex` on the\n tag itself before the thumb would take a width; that is the library's\n job, not three copies of the same rule in three apps. */\n display: block;\n\n a {\n display: flex;\n width: calc(100% - var(--ui-border-width) * 2);\n background-color: var(--ui-c-fourthly);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n overflow: hidden;\n }\n\n figure {\n position: relative;\n display: flex;\n width: 100%;\n margin: 0;\n\n z-index: 0;\n img {\n width: 100%;\n }\n figcaption {\n position: absolute;\n left: 0;\n bottom: 0;\n display: flex;\n width: 100%;\n height: fit-content;\n border: 0;\n color: var(--ui-c-default);\n background-color: rgba(var(--ui-c-background-value), 0.6);\n padding: calc(var(--ui-spacer) * 0.125);\n z-index: 1;\n }\n /* Zoom levels are consumer-configurable via the --ui-thumb-scale(-hover)\n custom properties (set them on the ui-thumb host element). */\n picture {\n transition: transform var(--ui-time);\n transform: scale(var(--ui-thumb-scale, 1));\n }\n picture:hover {\n transform: scale(var(--ui-thumb-scale-hover, 1.4));\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
1
|
+
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3925],{"./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/src/lib/atoms/thumb/thumb.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Thumb:()=>Thumb,ThumbInternalLink:()=>ThumbInternalLink,ThumbTheme:()=>ThumbTheme,__namedExportsOrder:()=>__namedExportsOrder,default:()=>thumb_component_stories});var _router_module_chunk=__webpack_require__("./node_modules/@angular/router/fesm2022/_router_module-chunk.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 thumb_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/thumb/thumb.component.css?ngResource"),thumb_componentngResource_default=__webpack_require__.n(thumb_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");let UiThumbComponent=class UiThumbComponent{data=(0,core.input)(null);static propDecorators={data:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"data",required:!1,transform:void 0}]}]}};UiThumbComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-thumb",template:'@if (data()) {\n @if (data()!.routerLink) {\n <a\n [routerLink]="data()!.routerLink"\n [fragment]="data()!.fragment || undefined"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n } @else {\n <a\n [attr.href]="data()!.link || null"\n [attr.target]="data()!.target || null"\n >\n <ng-container *ngTemplateOutlet="figure"></ng-container>\n </a>\n }\n}\n\n<ng-template #figure>\n <figure>\n @if (data()!.title) {\n <figcaption>\n <span class="ui-ellipsis"> {{ data()!.title }}</span>\n </figcaption>\n }\n <picture>\n @if (data()!.srcWebp) {\n <source\n [srcset]="data()!.srcWebp"\n type="image/webp"\n />\n }\n <img [src]="data()!.src" [alt]="data()!.alt" />\n </picture>\n </figure>\n</ng-template>\n',encapsulation:_debug_node_chunk.gXe.Emulated,imports:[_common_module_chunk.T3,_router_module_chunk.Wk],styles:[thumb_componentngResource_default()]})],UiThumbComponent);const thumb_component_stories={title:"Atoms/Thumb",component:UiThumbComponent,decorators:[(0,dist.L4)({providers:[(0,_router_module_chunk.lh)([{path:"**",children:[]}])]}),(0,dist.Iz)({imports:[header_component.b,UiThumbComponent]})],argTypes:{data:{control:"object"}},args:{data:{link:"#",title:"thumb-title",target:"_blank",src:"https://moja.work/content/_assets/pictures/numbers/10/numbers-001.png",srcWebp:null,alt:"thumb alt"}},parameters:{docs:{canvas:{sourceState:"none"}}}},Thumb={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbInternalLink={args:{data:{link:null,title:"thumb-internal-title",target:null,src:"https://moja.work/content/_assets/pictures/numbers/10/numbers-002.png",srcWebp:null,alt:"thumb alt",routerLink:"/target-page",fragment:"anchor-id",routerLink:".",fragment:"demo"}},render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},ThumbTheme={render:args=>({props:{...args},template:'\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n '})},__namedExportsOrder=["Thumb","ThumbInternalLink","ThumbTheme"];Thumb.parameters={...Thumb.parameters,docs:{...Thumb.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...Thumb.parameters?.docs?.source}}},ThumbInternalLink.parameters={...ThumbInternalLink.parameters,docs:{...ThumbInternalLink.parameters?.docs,source:{originalSource:'{\n args: {\n // Neutralized navigation: story links must never leave Storybook, so\n // the routerLink points at the current route (fragment only).\n data: {\n ...uiAtomThumbInternalMock,\n routerLink: \'.\',\n fragment: \'demo\'\n }\n },\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbInternalLink.parameters?.docs?.source}}},ThumbTheme.parameters={...ThumbTheme.parameters,docs:{...ThumbTheme.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header [display]="true" [onTop]="true" theme="theme-dark"></ui-intern-header>\n <section class="relative flex flex-col w-96">\n <ui-thumb [data]="data"></ui-thumb>\n </section>\n `\n };\n }\n}',...ThumbTheme.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/atoms/thumb/thumb.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 /* A box of its own. Every consumer used to declare `display: flex` on the\n tag itself before the thumb would take a width; that is the library's\n job, not three copies of the same rule in three apps. */\n display: block;\n\n a {\n display: flex;\n width: calc(100% - var(--ui-border-width) * 2);\n background-color: var(--ui-c-fourthly);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n overflow: hidden;\n }\n\n figure {\n position: relative;\n display: flex;\n width: 100%;\n margin: 0;\n\n z-index: 0;\n img {\n width: 100%;\n }\n figcaption {\n position: absolute;\n left: 0;\n bottom: 0;\n display: flex;\n width: 100%;\n height: fit-content;\n border: 0;\n color: var(--ui-c-default);\n background-color: rgba(var(--ui-c-background-value), 0.6);\n padding: calc(var(--ui-spacer) * 0.125);\n z-index: 1;\n }\n /* Zoom levels are consumer-configurable via the --ui-thumb-scale(-hover)\n custom properties (set them on the ui-thumb host element). */\n picture {\n transition: transform var(--ui-time);\n transform: scale(var(--ui-thumb-scale, 1));\n }\n picture:hover {\n transform: scale(var(--ui-thumb-scale-hover, 1.4));\n }\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[4713,4806],{"./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/.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/atoms/typewriter/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"),_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/typewriter/typewriter.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_typewriter_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-typewriter.json");function _createMdxContent(props){const _components={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:_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"typewriter",children:"Typewriter"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A reusable Angular component that creates a typewriter effect, displaying text character by character."}),"\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__.jsx)(_components.p,{children:"Reveals a text one character at a time, with an optional keystroke sound. Text\nand speed restart the run when they change; the sound, its source and the volume\ndo not. It types what it is handed and stops at the end — there is no loop and\nno queue of sentences; a second text is a new run."}),"\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-typewriter",entry:_guide_ui_typewriter_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:"UiTypewriterComponent"})," reveals a text one character at a time, with an\noptional keystroke sound. The text and the speed restart the run when they\nchange; the sound, its source and the volume do not — switching the sound on\nmid-sentence leaves the sentence where it is. That matters to real callers: a\npage that starts silent and clacks only after the first Play must not jump\nback to its first letter the moment it is allowed to."]}),"\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__.jsx)(_components.p,{children:"The following properties can be used to configure the typewriter:"}),"\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:"Property"}),(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)("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:"text"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input.required<string>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The text to be displayed with the typewriter effect; a change restarts the run."})]}),(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:"speed"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The delay between characters in milliseconds (default: 50); a change restarts the run."})]}),(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:"volume"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["The volume of the typing sound, 0.0 to 1.0 (default: 0.2) — the range ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"HTMLMediaElement.volume"})," takes; the browser throws on anything else, and so does this."]})]}),(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:"sound"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<boolean>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Whether to play a sound on each keystroke (default: true). The clip is fetched the moment this is on, not before."})]}),(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:"src"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<string>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["URL of the keystroke audio file. Defaults to the house sound on"," ","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"moja.work"}),", so it only needs setting for a different one —\nor when the component has to run without reaching that host."]})})]}),(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:"typingFinish"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<void>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when the typewriter effect has finished displaying all text."})]})]})]}),"\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:"basic-example",children:"Basic Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"In this example, you can see the typewriter effect in action. You can adjust the text and speed using the controls."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__.Typewriter}),"\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:"accessibility",children:"Accessibility"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The revealed part is hidden from assistive technology — a reader would get\nthe sentence in pieces, once per character. The whole text stands once in\nthe tag, visually hidden, so a reader gets the sentence and a viewer gets\nthe animation."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Usage"})}),"\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-typewriter\n [text]="\'404: Internet not found\'"\n [speed]="100"\n [volume]="0.5"\n [sound]="true"\n (typingFinish)="onFinish()">\n</ui-typewriter>\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/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
|
+
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[4713,4806],{"./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/.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/atoms/typewriter/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"),_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/typewriter/typewriter.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_typewriter_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-typewriter.json");function _createMdxContent(props){const _components={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:_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"typewriter",children:"Typewriter"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A reusable Angular component that creates a typewriter effect, displaying text character by character."}),"\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__.jsx)(_components.p,{children:"Reveals a text one character at a time, with an optional keystroke sound. Text\nand speed restart the run when they change; the sound, its source and the volume\ndo not. It types what it is handed and stops at the end — there is no loop and\nno queue of sentences; a second text is a new run."}),"\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-typewriter",entry:_guide_ui_typewriter_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:"UiTypewriterComponent"})," reveals a text one character at a time, with an\noptional keystroke sound. The text and the speed restart the run when they\nchange; the sound, its source and the volume do not — switching the sound on\nmid-sentence leaves the sentence where it is. That matters to real callers: a\npage that starts silent and clacks only after the first Play must not jump\nback to its first letter the moment it is allowed to."]}),"\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__.jsx)(_components.p,{children:"The following properties can be used to configure the typewriter:"}),"\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:"Property"}),(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)("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:"text"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input.required<string>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The text to be displayed with the typewriter effect; a change restarts the run."})]}),(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:"speed"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The delay between characters in milliseconds (default: 50); a change restarts the run."})]}),(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:"volume"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["The volume of the typing sound, 0.0 to 1.0 (default: 0.2) — the range ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"HTMLMediaElement.volume"})," takes; the browser throws on anything else, and so does this."]})]}),(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:"sound"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<boolean>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Whether to play a sound on each keystroke (default: true). The clip is fetched the moment this is on, not before."})]}),(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:"src"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"input<string>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["URL of the keystroke audio file. Defaults to the house sound on"," ","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"moja.work"}),", so it only needs setting for a different one —\nor when the component has to run without reaching that host."]})})]}),(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:"typingFinish"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<void>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when the typewriter effect has finished displaying all text."})]})]})]}),"\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:"basic-example",children:"Basic Example"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"In this example, you can see the typewriter effect in action. You can adjust the text and speed using the controls."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_typewriter_component_stories__WEBPACK_IMPORTED_MODULE_4__.Typewriter}),"\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:"accessibility",children:"Accessibility"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The revealed part is hidden from assistive technology — a reader would get\nthe sentence in pieces, once per character. The whole text stands once in\nthe tag, visually hidden, so a reader gets the sentence and a viewer gets\nthe animation."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Usage"})}),"\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-typewriter\n [text]="\'404: Internet not found\'"\n [speed]="100"\n [volume]="0.5"\n [sound]="true"\n (typingFinish)="onFinish()">\n</ui-typewriter>\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/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/content/_assets/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()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
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/content/_assets/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()}}]);
|