@mojawork/ui-docs 2.5.0 → 2.6.1
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/background.md +2 -0
- package/catalog/atoms/barcode.md +6 -0
- package/catalog/atoms/buzzer.md +4 -0
- package/catalog/atoms/card.md +2 -0
- package/catalog/atoms/chart.md +6 -0
- package/catalog/atoms/clock.md +14 -0
- package/catalog/atoms/copy-value.md +6 -0
- package/catalog/atoms/lang-selector.md +6 -0
- package/catalog/atoms/mosaic.md +4 -0
- package/catalog/atoms/placeholder.md +6 -0
- package/catalog/atoms/qr-code.md +12 -0
- package/catalog/atoms/rating.md +4 -0
- package/catalog/atoms/reader-doc.md +18 -0
- package/catalog/atoms/text-animate.md +2 -0
- package/catalog/atoms/thumb.md +4 -0
- package/catalog/atoms/timer.md +4 -0
- package/catalog/atoms/typewriter.md +2 -0
- package/catalog/forms/autocomplete.md +6 -0
- package/catalog/forms/checkbox.md +2 -0
- package/catalog/forms/input.md +2 -0
- package/catalog/forms/slider.md +2 -0
- package/catalog/forms/switch.md +2 -0
- package/catalog/guide.json +11 -11
- package/catalog/layout/header.md +4 -0
- package/catalog/layout/media-screen.md +2 -0
- package/catalog/layout/tabs.md +2 -0
- package/catalog/manifest.json +382 -75
- package/catalog/mcp.json +2 -2
- package/catalog/molecules/image-editor.md +34 -19
- package/catalog/usage.md +28 -8
- package/catalog/version.json +2 -2
- package/package.json +1 -1
- package/storybook/4555.251b232c.iframe.bundle.js +1 -0
- package/storybook/assets/ui/i18n/ui/de-DE.json +0 -1
- package/storybook/assets/ui/i18n/ui/en-EN.json +0 -1
- package/storybook/{home-overview-mdx.af727f5b.iframe.bundle.js → home-overview-mdx.0d4ede52.iframe.bundle.js} +1 -1
- package/storybook/home-usage-mdx.fc05feec.iframe.bundle.js +1 -0
- package/storybook/iframe.html +3 -3
- package/storybook/index.json +1 -1
- package/storybook/{main.2d116a57.iframe.bundle.js → main.1f12809e.iframe.bundle.js} +1 -1
- package/storybook/{main.a402659c6a0734088d14.css → main.e33bfc7e33aad318b1d2.css} +4 -0
- package/storybook/molecules-image-editor-docs-mdx.805dcd5a.iframe.bundle.js +1 -0
- package/storybook/molecules-image-editor-image-editor-component-stories.fbfeff1b.iframe.bundle.js +1 -0
- package/storybook/project.json +1 -1
- package/storybook/{runtime~main.be00d4a7.iframe.bundle.js → runtime~main.52ba2f02.iframe.bundle.js} +1 -1
- package/storybook/{styling-layers-docs-mdx.5039dc45.iframe.bundle.js → styling-layers-docs-mdx.a563260e.iframe.bundle.js} +1 -1
- package/storybook/version.json +2 -2
- package/version.json +2 -2
- package/storybook/4555.066c242d.iframe.bundle.js +0 -1
- package/storybook/home-usage-mdx.b908934f.iframe.bundle.js +0 -1
- package/storybook/molecules-image-editor-docs-mdx.119ea12a.iframe.bundle.js +0 -1
- package/storybook/molecules-image-editor-image-editor-component-stories.56467f17.iframe.bundle.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[4555],{"./libs/ui/guide sync \\.json$"(module,__unused_webpack_exports,__webpack_require__){var map={"./app-shell.json":"./libs/ui/guide/app-shell.json","./burger-menu.json":"./libs/ui/guide/burger-menu.json","./form-basics.json":"./libs/ui/guide/form-basics.json","./image-gallery.json":"./libs/ui/guide/image-gallery.json","./table-edit-focus.json":"./libs/ui/guide/table-edit-focus.json","./translations.json":"./libs/ui/guide/translations.json","./ui-autocomplete.json":"./libs/ui/guide/ui-autocomplete.json","./ui-background.json":"./libs/ui/guide/ui-background.json","./ui-barcode.json":"./libs/ui/guide/ui-barcode.json","./ui-buzzer.json":"./libs/ui/guide/ui-buzzer.json","./ui-card.json":"./libs/ui/guide/ui-card.json","./ui-cdk-drag-drop-splitter.json":"./libs/ui/guide/ui-cdk-drag-drop-splitter.json","./ui-cdk-table-wrapper.json":"./libs/ui/guide/ui-cdk-table-wrapper.json","./ui-chart.json":"./libs/ui/guide/ui-chart.json","./ui-checkbox.json":"./libs/ui/guide/ui-checkbox.json","./ui-clock.json":"./libs/ui/guide/ui-clock.json","./ui-copy-value.json":"./libs/ui/guide/ui-copy-value.json","./ui-image-editor.json":"./libs/ui/guide/ui-image-editor.json","./ui-image-grid.json":"./libs/ui/guide/ui-image-grid.json","./ui-image-slider.json":"./libs/ui/guide/ui-image-slider.json","./ui-input.json":"./libs/ui/guide/ui-input.json","./ui-lang-selector.json":"./libs/ui/guide/ui-lang-selector.json","./ui-layout-main.json":"./libs/ui/guide/ui-layout-main.json","./ui-layout-media-screen.json":"./libs/ui/guide/ui-layout-media-screen.json","./ui-layout-nav.json":"./libs/ui/guide/ui-layout-nav.json","./ui-layout-overlay-header.json":"./libs/ui/guide/ui-layout-overlay-header.json","./ui-layout-overlay.json":"./libs/ui/guide/ui-layout-overlay.json","./ui-layout-spinner.json":"./libs/ui/guide/ui-layout-spinner.json","./ui-layout-splitter.json":"./libs/ui/guide/ui-layout-splitter.json","./ui-layout-tabs.json":"./libs/ui/guide/ui-layout-tabs.json","./ui-layout-top-scroll-bottom.json":"./libs/ui/guide/ui-layout-top-scroll-bottom.json","./ui-mosaic.json":"./libs/ui/guide/ui-mosaic.json","./ui-placeholder.json":"./libs/ui/guide/ui-placeholder.json","./ui-qr-code.json":"./libs/ui/guide/ui-qr-code.json","./ui-rating.json":"./libs/ui/guide/ui-rating.json","./ui-reader-doc.json":"./libs/ui/guide/ui-reader-doc.json","./ui-slider.json":"./libs/ui/guide/ui-slider.json","./ui-switch.json":"./libs/ui/guide/ui-switch.json","./ui-text-animate.json":"./libs/ui/guide/ui-text-animate.json","./ui-thumb.json":"./libs/ui/guide/ui-thumb.json","./ui-timer.json":"./libs/ui/guide/ui-timer.json","./ui-typewriter.json":"./libs/ui/guide/ui-typewriter.json","libs/ui/guide/app-shell.json":"./libs/ui/guide/app-shell.json","libs/ui/guide/burger-menu.json":"./libs/ui/guide/burger-menu.json","libs/ui/guide/form-basics.json":"./libs/ui/guide/form-basics.json","libs/ui/guide/image-gallery.json":"./libs/ui/guide/image-gallery.json","libs/ui/guide/table-edit-focus.json":"./libs/ui/guide/table-edit-focus.json","libs/ui/guide/translations.json":"./libs/ui/guide/translations.json","libs/ui/guide/ui-autocomplete.json":"./libs/ui/guide/ui-autocomplete.json","libs/ui/guide/ui-background.json":"./libs/ui/guide/ui-background.json","libs/ui/guide/ui-barcode.json":"./libs/ui/guide/ui-barcode.json","libs/ui/guide/ui-buzzer.json":"./libs/ui/guide/ui-buzzer.json","libs/ui/guide/ui-card.json":"./libs/ui/guide/ui-card.json","libs/ui/guide/ui-cdk-drag-drop-splitter.json":"./libs/ui/guide/ui-cdk-drag-drop-splitter.json","libs/ui/guide/ui-cdk-table-wrapper.json":"./libs/ui/guide/ui-cdk-table-wrapper.json","libs/ui/guide/ui-chart.json":"./libs/ui/guide/ui-chart.json","libs/ui/guide/ui-checkbox.json":"./libs/ui/guide/ui-checkbox.json","libs/ui/guide/ui-clock.json":"./libs/ui/guide/ui-clock.json","libs/ui/guide/ui-copy-value.json":"./libs/ui/guide/ui-copy-value.json","libs/ui/guide/ui-image-editor.json":"./libs/ui/guide/ui-image-editor.json","libs/ui/guide/ui-image-grid.json":"./libs/ui/guide/ui-image-grid.json","libs/ui/guide/ui-image-slider.json":"./libs/ui/guide/ui-image-slider.json","libs/ui/guide/ui-input.json":"./libs/ui/guide/ui-input.json","libs/ui/guide/ui-lang-selector.json":"./libs/ui/guide/ui-lang-selector.json","libs/ui/guide/ui-layout-main.json":"./libs/ui/guide/ui-layout-main.json","libs/ui/guide/ui-layout-media-screen.json":"./libs/ui/guide/ui-layout-media-screen.json","libs/ui/guide/ui-layout-nav.json":"./libs/ui/guide/ui-layout-nav.json","libs/ui/guide/ui-layout-overlay-header.json":"./libs/ui/guide/ui-layout-overlay-header.json","libs/ui/guide/ui-layout-overlay.json":"./libs/ui/guide/ui-layout-overlay.json","libs/ui/guide/ui-layout-spinner.json":"./libs/ui/guide/ui-layout-spinner.json","libs/ui/guide/ui-layout-splitter.json":"./libs/ui/guide/ui-layout-splitter.json","libs/ui/guide/ui-layout-tabs.json":"./libs/ui/guide/ui-layout-tabs.json","libs/ui/guide/ui-layout-top-scroll-bottom.json":"./libs/ui/guide/ui-layout-top-scroll-bottom.json","libs/ui/guide/ui-mosaic.json":"./libs/ui/guide/ui-mosaic.json","libs/ui/guide/ui-placeholder.json":"./libs/ui/guide/ui-placeholder.json","libs/ui/guide/ui-qr-code.json":"./libs/ui/guide/ui-qr-code.json","libs/ui/guide/ui-rating.json":"./libs/ui/guide/ui-rating.json","libs/ui/guide/ui-reader-doc.json":"./libs/ui/guide/ui-reader-doc.json","libs/ui/guide/ui-slider.json":"./libs/ui/guide/ui-slider.json","libs/ui/guide/ui-switch.json":"./libs/ui/guide/ui-switch.json","libs/ui/guide/ui-text-animate.json":"./libs/ui/guide/ui-text-animate.json","libs/ui/guide/ui-thumb.json":"./libs/ui/guide/ui-thumb.json","libs/ui/guide/ui-timer.json":"./libs/ui/guide/ui-timer.json","libs/ui/guide/ui-typewriter.json":"./libs/ui/guide/ui-typewriter.json"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./libs/ui/guide sync \\.json$"},"./libs/ui/.storybook/blocks/guide.entries.js"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{H:()=>guideEntries});const context=__webpack_require__("./libs/ui/guide sync \\.json$"),guideEntries=context.keys().filter(key=>key.startsWith("./")).map(key=>{const entry=context(key);return entry.default??entry});if(0===guideEntries.length)throw new Error("guide: libs/ui/guide/ holds no entries — an empty guide is a generator bug, not an empty page.");const subjects=guideEntries.map(e=>e.component??e.situation),twice=subjects.find((s,i)=>subjects.indexOf(s)!==i);if(twice)throw new Error(`guide: "${twice}" is listed twice — one entry per subject, or the overview lies about the count.`)},"./libs/ui/.storybook/blocks/guide.model.mjs"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Cc:()=>guideModel,ED:()=>reviewedStamps,K9:()=>indexRows});var storybook_internal_csf__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/storybook/dist/csf/index.js");function storyHref(story){const cut=story.lastIndexOf("/");if(cut<=0||cut===story.length-1)throw new Error(`guide: story reference "${story}" is not "Title/Export".`);const title=story.slice(0,cut),name=story.slice(cut+1);return`?path=/story/${(0,storybook_internal_csf__WEBPACK_IMPORTED_MODULE_0__.Lr)(title,(0,storybook_internal_csf__WEBPACK_IMPORTED_MODULE_0__.bE)(name))}`}const subjectOf=entry=>entry.component??entry.situation;function pageOf(entries,subject){const entry=entries.find(e=>subjectOf(e)===subject),story=entry?.shownIn.find(r=>r.story)?.story;return story?(title=story.slice(0,story.lastIndexOf("/")),`?path=/docs/${(0,storybook_internal_csf__WEBPACK_IMPORTED_MODULE_0__.aj)(title)}--docs`):null;var title}function guideModel(entry,entries,of){if(!entry||"object"!=typeof entry)throw new Error(`guide: no entry handed to the block for "${of}".`);const subject=subjectOf(entry);if(void 0!==of&&subject!==of)throw new Error(`guide: the block on "${of}" was handed the entry of "${subject}" — wrong import.`);for(const key of["useFor","notFor","shownIn","sources"])if(!Array.isArray(entry[key]))throw new Error(`guide: entry "${subject}" has no "${key}" list.`);if(0===entry.shownIn.length)throw new Error(`guide: entry "${subject}" shows nothing — no proof, no block.`);return{subject,kind:entry.component?"component":"situation",uses:(entry.uses??[]).map(s=>({selector:s,href:pageOf(entries,s)})),useFor:entry.useFor,notFor:entry.notFor,instead:(entry.instead??[]).map(s=>({selector:s,href:pageOf(entries,s)})),note:entry.note??null,shownIn:entry.shownIn.map(r=>r.story?{label:r.story,href:storyHref(r.story)}:{label:r.file,href:null}),sources:entry.sources,reviewed:entry.reviewed}}function indexRows(entries){if(!Array.isArray(entries)||0===entries.length)throw new Error("guide: the overview has no entries — an empty guide is a generator bug, not an empty page.");return entries.map(e=>({subject:subjectOf(e),kind:e.component?"component":"situation",brief:e.useFor[0],href:pageOf(entries,subjectOf(e))})).sort((a,b)=>a.kind===b.kind?a.subject.localeCompare(b.subject):"situation"===a.kind?1:-1)}const reviewedStamps=entries=>[...new Set(entries.map(e=>e.reviewed))]},"./libs/ui/guide/app-shell.json"(module){"use strict";module.exports=JSON.parse('{"situation":"app-shell","uses":["ui-layout-main","ui-layout-nav","ui-layout-splitter","ui-layout-tabs"],"useFor":["The four layout components nested by content projection: main holds the nav in its header and the page in its content; a splitter inside the content holds tabs in its left pane. Each slot is a named attribute on your own element."],"notFor":["Overlays — they stand next to the layout, not inside it."],"shownIn":[{"story":"Examples/Layout/Layout"},{"file":"libs/ui/.storybook/demos/examples/layout/docs.mdx"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/.storybook/demos/examples/layout/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/burger-menu.json"(module){"use strict";module.exports=JSON.parse('{"situation":"burger-menu","uses":["ui-layout-overlay","ui-layout-overlay-header"],"useFor":["A navigation drawer behind a burger button: the overlay with direction=\\"right\\", the header with its close, a plain link list in the overlay-content slot; every link click resets the open flag. Backdrop, Escape and the scroll-lock come with the overlay."],"notFor":["The main navigation on a wide screen — that is ui-layout-nav in the main header."],"shownIn":[{"story":"Examples/Burger Menu/BurgerMenu"},{"file":"libs/ui/src/lib/examples/docs.mdx"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/examples/docs.mdx","libs/ui/src/lib/layout/overlay/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/form-basics.json"(module){"use strict";module.exports=JSON.parse('{"situation":"form-basics","uses":["ui-input","ui-checkbox","ui-switch","ui-slider"],"useFor":["Every form in the house: <ui-input [label]=\\"…\\"><input ui-tag class=\\"ui\\" [(ngModel)]=\\"…\\" /></ui-input>. The wrapper brings label and error display, the native control keeps value, validation and type. class=\\"ui\\" on the control; class=\\"ui-flat\\" where it sits inline in a table cell."],"notFor":["A control without the class — it renders unstyled.","A validator written in the app: validators belong in the library."],"shownIn":[{"story":"Styling/Forms/Forms"},{"story":"Forms/Validators/Email"},{"file":"apps/change-me/src/app/slider/slider.component.html"}],"sources":["usage.md (Forms)","libs/ui/src/lib/forms/input/docs.mdx","libs/ui/src/lib/forms/validators/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/image-gallery.json"(module){"use strict";module.exports=JSON.parse('{"situation":"image-gallery","uses":["ui-image-grid","ui-image-slider"],"useFor":["Grid and slider sharing one index: side by side, or the slider created with @if as the zoom — two clicks by design of the grid, the first selects, the second (on the projected uiImageGridClickArea) emits clickIndex."],"notFor":["A single linked preview — ui-thumb."],"shownIn":[{"story":"Examples/Image Gallery/ImageGallery"},{"story":"Examples/Image Gallery/ImageGalleryZoom"},{"file":"libs/ui/.storybook/demos/examples/image-grid-slider/docs.mdx"},{"file":"apps/website/src/app/content/image-grid/image-grid.component.html"}],"sources":["libs/ui/.storybook/demos/examples/image-grid-slider/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/table-edit-focus.json"(module){"use strict";module.exports=JSON.parse('{"situation":"table-edit-focus","uses":["ui-cdk-table-wrapper","ui-input","ui-checkbox"],"useFor":["An inline-editing table walked by keyboard: the wrapper in inline fixed mode with the uiTableEditFocus directive; fields as ui-flat controls; the app answers uiRowNavigate and uiRowStep — the only two questions the library does not answer itself: may this row open, and what does locked mean — and calls focusCell() after it re-rendered the edit row."],"notFor":["A wrapper without inline mode: the cells shift when a text turns into a field.","Counting positions instead of naming buttons — the edit row carries more buttons than a read row."],"shownIn":[{"story":"Examples/Table Edit Focus/TableEditFocus"},{"story":"Examples/Table Edit Focus/TableEditFocusTall"},{"file":"libs/ui/.storybook/demos/examples/table-edit-focus/docs.mdx"},{"file":"apps/proto/src/app/examples/keyboard-table/keyboard-table.component.html"},{"file":"apps/proto/src/app/examples/keyboard-table/keyboard-table.component.ts"}],"sources":["libs/ui/.storybook/demos/examples/table-edit-focus/docs.mdx","libs/ui/src/lib/cdk/components/table/docs.mdx","media CLAUDE.md (own repo): Keyboard navigation — who owns what","tickets#168","tickets#169"],"reviewed":"69197b72"}')},"./libs/ui/guide/translations.json"(module){"use strict";module.exports=JSON.parse('{"situation":"translations","uses":["ui-lang-selector"],"useFor":["Loading the library\'s translation files alongside the app\'s own with Transloco; the selector switches both. The list of every key the library ships is generated from the loaded translation, never written beside it."],"notFor":["Translating inside a computed — it snapshots an empty dictionary on first render; use the pipe, or a translate helper that listens."],"shownIn":[{"story":"Examples/Transloco/LangSelector"},{"story":"Examples/Transloco/AllKeys"},{"file":"libs/ui/.storybook/demos/examples/transloco/docs.mdx"}],"sources":["libs/ui/.storybook/demos/examples/transloco/docs.mdx","media CLAUDE.md (own repo): translate() inside a computed is a snapshot","tickets#182"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-autocomplete.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-autocomplete","useFor":["An input whose suggestions the host supplies — an in-memory list, signals or a backend; minChars and delay keep the requests civil, the component never fetches."],"notFor":["Multi-select, chips, a dropdown of fixed options — a native select inside ui-input does the last.","A waiting state or an empty message: there is none by design."],"instead":["ui-input"],"shownIn":[{"story":"Forms/Autocomplete/Autocomplete"},{"story":"Forms/Autocomplete/Loading"}],"sources":["libs/ui/src/lib/forms/autocomplete/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-background.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-background","useFor":["A patterned surface behind projected content — change-me\'s slider page puts its form on one."],"notFor":["Layout; a plain colour, which is one CSS line."],"shownIn":[{"story":"Atoms/Background/BackgroundExample"},{"file":"apps/change-me/src/app/slider/slider.component.html"}],"sources":["libs/ui/src/lib/atoms/background/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-barcode.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-barcode","useFor":["Drawing an EAN-13 the app already holds — an ISBN, an internal id under its own prefix. Size comes from the outside; a utility class on the tag wins."],"notFor":["Deciding which number to draw, printing it, or reacting to a click — that stays with the app.","Any symbology but EAN-13."],"note":"Wrap it in ui-copy-value to copy the digits; the bars stay the picture.","shownIn":[{"story":"Atoms/Barcode/Default"},{"story":"Atoms/Barcode/Sizes"}],"sources":["libs/ui/src/lib/atoms/barcode/docs.mdx","media frontend (own repo): internal-barcode.spec.ts, tickets#205"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-buzzer.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-buzzer","useFor":["One big, deliberate action — a contact trigger, a push button. The website uses it twice."],"notFor":["Ordinary form buttons: those are button.ui and button.ui-flat."],"shownIn":[{"story":"Atoms/Buzzer/Buzzer"},{"file":"apps/website/src/app/content/contact/contact.component.html"},{"file":"apps/website/src/app/components/push-button/push-button.component.html"}],"sources":["libs/ui/src/lib/atoms/buzzer/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-card.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-card","useFor":["A bounded surface with an optional headline and icon around projected content — a tile, a panel, a summary."],"notFor":["Anything that has to act: copying, linking, expanding. The card is presentational and composes nothing."],"instead":["ui-copy-value"],"note":"For a copyable card, wrap it: <ui-copy-value [value]=\\"…\\"><ui-card …></ui-card></ui-copy-value>. One job per component; composition, not a mode, adds the second.","shownIn":[{"story":"Atoms/Card/Card"}],"sources":["libs/ui/src/lib/atoms/card/docs.mdx","tickets#183"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-cdk-drag-drop-splitter.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-cdk-drag-drop-splitter","useFor":["Sorting items into two buckets by drag and drop. Bind both outputs and hand the new arrays back, or nothing moves."],"notFor":["A two-pane layout.","A list that persists itself."],"instead":["ui-layout-splitter"],"shownIn":[{"story":"CDK/Drag And Drop Splitter/DragAndDropSplitter"}],"sources":["libs/ui/src/lib/cdk/components/drag-and-drop-splitter/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-cdk-table-wrapper.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-cdk-table-wrapper","useFor":["Any cdk-table in the house: loading skeleton, hover and focus, header colours, fixed or content layout.","Inline editing: inline fixed plus the uiTableEditFocus directive — the proto keyboard table and the media editor are built this way."],"notFor":["A table without the CDK.","Inline editing without inline mode: the cells shift when text turns into a field."],"shownIn":[{"story":"CDK/Table/Default"},{"story":"CDK/Table/Inline"},{"story":"Examples/Table Edit Focus/TableEditFocus"},{"file":"apps/proto/src/app/examples/keyboard-table/keyboard-table.component.html"}],"sources":["libs/ui/src/lib/cdk/components/table/docs.mdx","libs/ui/.storybook/demos/examples/table-edit-focus/docs.mdx","media CLAUDE.md (own repo): Keyboard navigation — who owns what"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-chart.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-chart","useFor":["A single ring or bar of up to three segments — a share, a progress. The number of colours is the number of rings."],"notFor":["Series, axes, legends, tooltips, more than three parts."],"shownIn":[{"story":"Atoms/Chart/Rings"}],"sources":["libs/ui/src/lib/atoms/chart/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-checkbox.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-checkbox","useFor":["A choice that may be required or validated, inside a form that reports errors.","Flag cells of an editable table row: icons while the row is closed, checkboxes while it is edited — the proto keyboard table does that with display=\\"check-icon\\"."],"notFor":["An always-valid toggle.","The native variant where Safari matters — the self-painted icon variant renders the same everywhere."],"instead":["ui-switch"],"shownIn":[{"story":"Forms/Checkbox/CheckboxIcon"},{"story":"Forms/Checkbox/CheckboxValidation"},{"file":"apps/proto/src/app/examples/keyboard-table/keyboard-table.component.html"}],"sources":["libs/ui/src/lib/forms/checkbox/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-clock.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-clock","useFor":["A decorative time display — the website\'s landscape overlay."],"notFor":["A countdown; anything that needs time zones or formats beyond 12/24 h."],"instead":["ui-timer"],"shownIn":[{"story":"Atoms/Clock/Default"},{"file":"apps/website/src/app/parts/landscape-overlay/landscape-overlay.component.html"}],"sources":["libs/ui/src/lib/atoms/clock/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-copy-value.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-copy-value","useFor":["Click-to-copy around anything that shows a value — a swatch, a barcode, a truncated label. What is shown and what is copied are two different things, and this carries the second."],"notFor":["Showing the value: it brings no appearance. Wrap the thing that does."],"note":"With an empty value it leaves the tab order and stops being a control, so it can stand around content unconditionally and be switched on by supplying a value.","shownIn":[{"story":"Atoms/Copy Value/Swatches"},{"story":"Atoms/Copy Value/OwnConfirmation"}],"sources":["libs/ui/src/lib/atoms/copy-value/docs.mdx","tickets#183"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-image-editor.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-image-editor","useFor":["Uploading and cropping one image to a ratio, result as a JPEG blob — a cover, an avatar. The media cover editor is the overlay variant; the embedded one sits in the flow."],"notFor":["Several images, drawing, filters.","Talking to a backend: it emits, the host uploads."],"shownIn":[{"story":"Molecules/Image Editor/WithImage"},{"story":"Molecules/Image Editor/Overlay"}],"sources":["libs/ui/src/lib/molecules/image-editor/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-image-grid.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-image-grid","useFor":["The overview of a picture set, sharing one index with ui-image-slider. Always set cols; the default draws nothing."],"notFor":["Showing one picture large — that is the slider\'s half."],"instead":["ui-image-slider"],"shownIn":[{"story":"Examples/Image Gallery/ImageGallery"},{"story":"Examples/Image Gallery/ImageGalleryZoom"},{"file":"apps/website/src/app/content/image-grid/image-grid.component.html"}],"sources":["libs/ui/src/lib/atoms/image-grid/docs.mdx","libs/ui/.storybook/demos/examples/image-grid-slider/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-image-slider.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-image-slider","useFor":["One picture at a time with swipe, drag and zoom; as the zoom of a grid, created with @if only while open."],"notFor":["The overview of a set."],"instead":["ui-image-grid"],"shownIn":[{"story":"Examples/Image Gallery/ImageGallery"},{"story":"Examples/Image Gallery/ImageGalleryZoom"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/atoms/image-slider/docs.mdx","libs/ui/.storybook/demos/examples/image-grid-slider/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-input.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-input","useFor":["Every text-based control in a form: wrap the native input, textarea or select, keep [(ngModel)] on the projected element, class=\\"ui\\" on it.","Inline editing in tables: the projected control takes class=\\"ui-flat\\" instead — invisible at rest, no layout jump. The proto keyboard table has sixteen of them."],"notFor":["Ranges, checkboxes, switches — they have wrappers of their own.","Suggestions while typing."],"instead":["ui-slider","ui-checkbox","ui-switch","ui-autocomplete"],"shownIn":[{"story":"Forms/Input/Input"},{"story":"Forms/Input/InputClearable"},{"file":"apps/change-me/src/app/slider/slider.component.html"},{"file":"apps/proto/src/app/examples/keyboard-table/keyboard-table.component.html"}],"sources":["libs/ui/src/lib/forms/input/docs.mdx","usage.md (Forms)"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-lang-selector.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-lang-selector","useFor":["The one language switch of an app: one tag brings the service call, the storage and the restore on reload."],"notFor":["More than the two languages it knows; a switch that must not persist."],"shownIn":[{"story":"Examples/Transloco/LangSelector"},{"story":"Atoms/Lang Selector/OwnContent"},{"file":"apps/website/src/app/components/lang-selector/lang-selector.component.html"}],"sources":["libs/ui/src/lib/atoms/lang-selector/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-main.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-main","useFor":["The root of an app shell, once: the nav in its header slot, the page in its content, a footer. The website and change-me both start here."],"notFor":["A panel inside a page — splitter, tabs and top-scroll-bottom are for that."],"shownIn":[{"story":"Examples/Layout/Layout"},{"file":"apps/website/src/app/app.component.html"},{"file":"apps/change-me/src/app/app.component.html"}],"sources":["libs/ui/src/lib/layout/main/docs.mdx","libs/ui/.storybook/demos/examples/layout/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-media-screen.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-media-screen","useFor":["Once in the app shell, so every breakpoint question goes to UiLayoutMediaScreenService — never a hard-coded width in TypeScript or a breakpoint through Tailwind."],"notFor":["Anything visible; a second instance."],"shownIn":[{"story":"Layout/Media Screen/MediaScreen"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/layout/media-screen/docs.mdx","media CLAUDE.md (own repo): breakpoints never go through Tailwind"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-nav.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-nav","useFor":["The app navigation in the main header, fed by UiLayoutNavService — tab theme for a site, app theme with a home button for a tool."],"notFor":["A second nav in the same layout.","A menu in a drawer — that is the burger recipe with ui-layout-overlay."],"instead":["ui-layout-overlay"],"shownIn":[{"story":"Layout/Nav/TemplateTab"},{"story":"Layout/Nav/TemplateApp"},{"story":"Examples/Layout/Layout"},{"file":"apps/website/src/app/parts/header/header.component.html"}],"sources":["libs/ui/src/lib/layout/nav/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-overlay-header.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-overlay-header","useFor":["The plain header of an overlay: headline plus close, in the overlay-header slot."],"notFor":["A header with anything else in it — write your own bar into the same slot. The media record sheet does, because its close turns into a two-step discard."],"shownIn":[{"story":"Layout/Overlay Header/InsideAnOverlay"},{"story":"Examples/Burger Menu/BurgerMenu"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/layout/overlay/header/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-overlay.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-overlay","useFor":["A drawer or a modal over the page — a burger menu, a sign-in sheet, a record editor. Place it at the app\'s top level next to the layout, bind active in and take activeOutput back."],"notFor":["Anything inside the layout tree.","A tooltip or a popover."],"shownIn":[{"story":"Examples/Burger Menu/BurgerMenu"},{"story":"Layout/Overlay/Overlay"},{"story":"Layout/Overlay/ScrollContainment"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/layout/overlay/docs.mdx","libs/ui/src/lib/examples/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-spinner.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-spinner","useFor":["The one global loading indicator at the app root, driven by UiLayoutSpinnerService from an HTTP interceptor."],"notFor":["A component\'s own loading state — the table wrapper has its skeleton, everything else is local styling."],"shownIn":[{"story":"Layout/Spinner/Spinner"},{"file":"apps/website/src/app/app.component.html"}],"sources":["libs/ui/src/lib/layout/spinner/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-splitter.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-splitter","useFor":["A working view with two panes and an action header. The media editor is one: table left, detail right, and the zoom is the handle that widens the table."],"notFor":["Moving items between two lists.","Resizing panes by dragging — it has direction, zoom and fullscreen, no drag handle."],"instead":["ui-cdk-drag-drop-splitter"],"shownIn":[{"story":"Layout/Splitter/Splitter"},{"story":"Examples/Layout/Layout"}],"sources":["libs/ui/src/lib/layout/splitter/docs.mdx","media CLAUDE.md (own repo): the 4K table shots and the zoom"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-tabs.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-tabs","useFor":["A few sections of one view switched in place, inside a pane."],"notFor":["Routing between pages.","Remembering the active tab across a reload."],"shownIn":[{"story":"Layout/Tabs/TabsDefault"},{"story":"Examples/Layout/Layout"}],"sources":["libs/ui/src/lib/layout/tabs/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-layout-top-scroll-bottom.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-layout-top-scroll-bottom","useFor":["A view whose middle scrolls while header and footer stay — once per route, inside main-content."],"notFor":["Anywhere outside ui-layout-main; a second one in the same view."],"shownIn":[{"story":"Layout/Top Scroll Bottom/TopScrollBottom"}],"sources":["libs/ui/src/lib/layout/top-scroll-bottom/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-mosaic.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-mosaic","useFor":["A decorative tile field behind a page or over a picture — placed with CSS, given a box."],"notFor":["Anything clickable (pointer events are off).","An element in the flow without a height — it renders nothing, because its tile count comes from its box."],"shownIn":[{"story":"Atoms/Mosaic/Images"},{"story":"Atoms/Mosaic/OverImage"}],"sources":["libs/ui/src/lib/atoms/mosaic/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-placeholder.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-placeholder","useFor":["Filler with visible mass in stories and examples, sized from the outside (class=\\"h-64\\") — so a reader can tell a stand-in from a component that failed to render."],"notFor":["Product UI. It is scenery for documentation."],"shownIn":[{"story":"Atoms/Placeholder/Sizes"},{"story":"Examples/Layout/Layout"}],"sources":["libs/ui/src/lib/atoms/placeholder/docs.mdx","agents.md (Storybook Guidelines: filler needs visible mass)"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-qr-code.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-qr-code","useFor":["A URL or a short text as a scannable code. M is the ordinary level; raise it for small prints or surfaces that get handled."],"notFor":["Payloads past the version-40 capacity at the chosen level; kanji or ECI encodings."],"shownIn":[{"story":"Atoms/QR Code/Default"},{"story":"Atoms/QR Code/Levels"}],"sources":["libs/ui/src/lib/atoms/qr-code/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-rating.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-rating","useFor":["Displaying a rating as filled icons — read-only, any Material glyph, colours and size as CSS variables."],"notFor":["Collecting a rating: it takes no input from the reader."],"shownIn":[{"story":"Atoms/Rating/Rating"}],"sources":["libs/ui/src/lib/atoms/rating/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-reader-doc.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-reader-doc","useFor":["Rendering a Markdown string in the house design — the website\'s content pages do. Whoever fetches, caches and picks the language stands in front of it."],"notFor":["Documents whose raw HTML must survive: it is discarded, counted and named on the page."],"shownIn":[{"story":"Atoms/ReaderDoc/Default"},{"story":"Atoms/ReaderDoc/DroppedMarkup"},{"file":"apps/website/src/app/content/content.component.html"}],"sources":["libs/ui/src/lib/atoms/reader-doc/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-slider.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-slider","useFor":["A number or a min–max span the reader drags until it looks right."],"notFor":["A value the reader should type exactly — ui-input with type=\\"number\\"."],"instead":["ui-input"],"shownIn":[{"story":"Forms/Slider/Slider"},{"story":"Forms/Slider/Range"}],"sources":["libs/ui/src/lib/forms/slider/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-switch.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-switch","useFor":["A deliberate on/off decision that takes effect at once and is valid either way — a setting, a filter, a mode."],"notFor":["A choice that can be required or invalid, such as a consent."],"instead":["ui-checkbox"],"shownIn":[{"story":"Forms/Switch/Switch"},{"story":"Styling/Forms/Forms"}],"sources":["libs/ui/src/lib/forms/switch/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-text-animate.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-text-animate","useFor":["A headline that animates letter by letter; clip on the container when a variant travels in from outside."],"notFor":["Body text or anything longer than a phrase."],"shownIn":[{"story":"Atoms/Text Animate/TextAnimate"},{"file":"apps/change-me/src/app/slider/slider.component.html"}],"sources":["libs/ui/src/lib/atoms/text-animate/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-thumb.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-thumb","useFor":["A linked preview image with a caption — playlist tiles, news, references on the website. Place it in a grid cell or give it a width."],"notFor":["A gallery of pictures sharing a selection.","An image without a link — a plain <img> does that."],"instead":["ui-image-grid"],"shownIn":[{"story":"Atoms/Thumb/Thumb"},{"story":"Atoms/Thumb/ThumbInternalLink"},{"file":"apps/website/src/app/content/youtube/youtube.component.html"},{"file":"apps/website/src/app/components/news/display/display.component.html"}],"sources":["libs/ui/src/lib/atoms/thumb/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-timer.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-timer","useFor":["A countdown with a finished event; project the words that stand at zero, in your language."],"notFor":["Showing the time of day."],"instead":["ui-clock"],"shownIn":[{"story":"Atoms/Timer/Timer"}],"sources":["libs/ui/src/lib/atoms/timer/docs.mdx"],"reviewed":"69197b72"}')},"./libs/ui/guide/ui-typewriter.json"(module){"use strict";module.exports=JSON.parse('{"component":"ui-typewriter","useFor":["A line of text that types itself, optionally with a keystroke sound — the website\'s platformer intro."],"notFor":["Body text; a loop — a second sentence is a new run."],"shownIn":[{"story":"Atoms/Typewriter/Typewriter"},{"file":"apps/website/src/app/components/platformer/platformer.component.html"}],"sources":["libs/ui/src/lib/atoms/typewriter/docs.mdx"],"reviewed":"69197b72"}')}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3842],{"./libs/ui/src/lib/home/usage.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 jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),lib=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),blocks=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js");const usage_namespaceObject="# Using @mojawork/ui\n\nThe usage contract of the library: the rules that hold for every application\nconsuming `@mojawork/ui`, inside or outside the workspace it is built in.\nThis file is the single source for these rules — the catalog serves it to\nagents through `get_usage`, and the workspace's shared agent rules point\nhere instead of restating it. The component pages remain the\ntruth about each component; this file holds what is true across all of them.\n\n## Signals and zoneless change detection\n\n- Use Angular Signals (`signal()`, `computed()`, `effect()`) for state and\n reactive logic instead of manual state or plain observables.\n- The library and its reference applications run **zoneless**\n (`provideZonelessChangeDetection()`, no `zone.js` polyfill). Any\n template-bound state that is updated from an async source\n (`setTimeout`/`setInterval`, RxJS `subscribe`, `Promise`,\n `requestAnimationFrame`) MUST be a signal (or use the `async` pipe /\n `toSignal()`); a plain field written from such a callback will not trigger\n change detection. Imperative DOM writes (e.g. `element.setAttribute`, CSS\n custom properties) do not need this.\n\n## Forms\n\nForm inputs follow one fixed format:\n\n```html\n<ui-input [label]=\"'Label'\">\n <input ui-tag [(ngModel)]=\"model\" ... />\n</ui-input>\n```\n\n## Styling and tokens\n\n- Components are styled with plain CSS on the design tokens\n (`var(--ui-spacer)`, `var(--ui-border-radius)`, the `--ui-c-*` colours).\n No CSS framework is required, and no Sass.\n- Host geometry is a named hook with a fallback, never a pinned value —\n e.g. `width: var(--ui-background-width, 100%)`. A consumer without\n Tailwind sets the variable; one with Tailwind puts a utility on the tag,\n and the cascade layers below make it win. Each component documents its\n hooks in its story.\n- The package itself is Tailwind-free; its templates carry no utility\n classes. Tailwind is optional at the consumer: the package ships a\n ready-made Tailwind v4 theme that maps the utilities onto the tokens,\n including light/dark switching and the `ms1:`–`ms6:` breakpoint ladder.\n\n## Cascade layers — the library sits below the utilities\n\nA utility you write on a ui tag must win against the component's own\ndefault. Tailwind v4 puts everything in cascade layers, and **unlayered CSS\nbeats layered CSS regardless of specificity** — the order of layers, not\nspecificity, decides who wins.\n\nThe library's styles live in the `ui` layer, declared before Tailwind's:\n\n```css\n@layer theme, base, cdk-resets, ui, components, utilities;\n@import 'tailwindcss';\n```\n\n**Every consumer with its own Tailwind entry declares the same line before\nits import.** A layer nobody names is appended behind all named ones and\nwould beat the whole library. `cdk-resets` is part of the line so the\nAngular CDK's drag-preview reset sits below the library instead of\nstripping every preview of its surface.\n\nWhat this means in practice: a Tailwind utility on a ui tag wins over the\ncomponent's default, and unlayered consumer CSS wins over both. A `!` on a\nutility against a ui tag is a symptom, not a fix — it means the layer line\nis missing somewhere.\n\n## Disabled controls and the keyboard\n\n`disabled` is not only a visual state — it changes where the focus can live,\nand it does so retroactively. Two failure modes come out of that, and both\nhave already cost real debugging time.\n\n**A control that disables itself throws the focus away.** The moment an\nelement becomes `disabled`, the browser removes the focus from it and drops it\non `<body>`. So a button whose own activation makes it inert — a reset that\nhas nothing left to undo, a save that dies once everything is saved, a \"load\nmore\" at the end of a list — leaves a keyboard user with no place at all. The\nrow they were working in is gone from under them, and the next Tab starts over\nat the top of the document.\n\nNo navigation logic can repair this. It happens **after** the activation, so\nby the time anything notices, the previous position no longer exists.\n\n**Custom keyboard navigation and the browser disagree about who counts.** The\nbrowser skips disabled controls in the tab order; hand-written navigation that\ncollects controls with a plain `'input, select, textarea, button, a'` counts\nthem. The two sets drift apart: a remembered position points into a different\nlist than the one the focus actually walks, and `focus()` on a disabled\nelement does nothing at all — the focus stays put and the next key press picks\nthe very same dead target again. The navigation jams, silently, with no error\nanywhere.\n\n**Preferred pattern: do not disable at all.** Keep the control **enabled** and\nlet its action be a no-op when there is nothing to do. Express unavailability\nthrough styling plus `aria-disabled=\"true\"` — that keeps the control\nfocusable and reachable while screen readers still announce it as\nunavailable. A dimmed control without `aria-disabled` is, to anyone who only\nlistens, an ordinary control: the look carries the message, and nobody hears a\nlook.\n\n**If a control genuinely must be disabled**, move the focus somewhere\ndeliberate **before** disabling it — the neighbouring control, the container,\nthe element that replaces it. Never leave that decision to the browser.\n\n**And when you write navigation yourself**, derive the control list from the\nDOM on every key press and filter it to what can actually take focus\n(`:not(:disabled):not([hidden]):not([tabindex=\"-1\"])`), so it can never\ndisagree with the native tab order. Never cache the list and never store\npositions as constants: a cell may hold a different number of stations from\none moment to the next.\n\n## Where the documentation lives\n\nThe component page is the truth — the fixed section \"What it does, and what\nit does not\" on every page. The guide is the offer next to it: use for, not\nfor, instead, with proof. Where the two disagree, the page wins.\n\n- **Storybook** — `https://moja.work/storybook`: every component, every\n story, the guide entries next to the truth sections. It describes the\n current line (behaviour can change within 2.x) — pin an exact version of\n the package rather than a `^` range.\n- **MCP catalog for agents** — `https://moja.work/ui/mcp`: the tools\n `list_components` (the shelf), `get_component_doc` (one page, verbatim)\n and `get_guide` (the recommendations plus these rules). If you know a\n component's selector, ask for it directly instead of fetching the whole\n guide and filtering it yourself.\n- **`llms.txt`** — `https://moja.work/llms.txt`: the catalog for crawlers\n and plain-text readers.\n- **API reference** — the `.d.ts` files in the installed package are the\n version-true API; the hosted Compodoc at `https://moja.work/compodoc/ui`\n describes the line.\n",usageMarkdown=(usage_namespaceObject.default??usage_namespaceObject).trim();if(""===usageMarkdown)throw new Error("usage: libs/ui/usage.md is empty — an empty contract is a generator bug, not an empty page.");function _createMdxContent(props){const _components={code:"code",p:"p",strong:"strong",...(0,lib.R)(),...props.components};return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(blocks.W8,{title:"Home/Usage"}),"\n",(0,jsx_runtime.jsxs)(_components.p,{children:["This page ",(0,jsx_runtime.jsx)(_components.strong,{children:"reads"})," ",(0,jsx_runtime.jsx)(_components.code,{children:"libs/ui/usage.md"})," — the usage contract of the library.\nThe npm package ships the same file verbatim as ",(0,jsx_runtime.jsx)(_components.code,{children:"usage.md"}),", and the\ncatalog serves it to agents through ",(0,jsx_runtime.jsx)(_components.code,{children:"get_usage"}),"; what stands here cannot\ndrift from either."]}),"\n",(0,jsx_runtime.jsx)(blocks.oz,{children:usageMarkdown})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,lib.R)(),...props.components};return MDXLayout?(0,jsx_runtime.jsx)(MDXLayout,{...props,children:(0,jsx_runtime.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3190],{"./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/molecules/image-editor/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_image_editor_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/molecules/image-editor/image-editor.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_image_editor_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-image-editor.json");function _createMdxContent(props){const _components={a:"a",code:"code",h1:"h1",h2:"h2",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:_image_editor_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h1,{id:"image-editor",children:"Image Editor"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["An editor for a single image. The user can delete the current image or\nupload a new one (PNG, GIF or JPEG), crop it (freely or locked to an aspect\nratio) and the result is converted to a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"JPEG entirely in the browser"})," via a\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<canvas>"})," (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"toBlob('image/jpeg', quality)"}),"). The finished blob is emitted through\nthe ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"save"})," output — the component itself never talks to a backend, so it is\nreusable across apps."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Client-side conversion means the server only has to store a small, finished\nJPEG: no server-side image library is required."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{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:["Edits one image in the browser: upload (PNG, GIF, JPEG), crop freely or to an\naspect ratio, delete, and emit the result as a JPEG blob through ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"save"}),". It\nnever talks to a backend and keeps no image beyond the one it is shown. It comes\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"embedded"})," in the flow or as an ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"overlay"})," — the same editor, not two. It is the\nlibrary's only molecule: it composes the overlay, the overlay header, the crop\nbox and the slider."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"ui-image-editor",entry:_guide_ui_image_editor_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.h2,{id:"variants",children:"Variants"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The same content comes in two presentations, selected by the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"variant"})," input:"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"embedded"})})," (default): the editor stands in the document flow like any\nother element — no frame, no backdrop, no focus trap, no Escape semantics.\nIt fills the width it is given; the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"maximum width is set by the consumer"}),"\nvia styles on the host or a wrapping element, the minimum emerges from the\nfooter button row (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"flex-wrap"})," as a safety net for very narrow screens).\nDelete, Save and Cancel-with-nothing-to-discard return the editor to a clean\nview mode instead of closing anything; ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"active"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"activeOutput"})," are not\nused."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"overlay"})}),": wraps the editor in the ui overlay as before — backdrop,\nfocus trap, Escape and the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"active"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"activeOutput"})," pair."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--with-image",children:"Open story"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-editor\n [imageUrl]="currentCover()"\n [aspectRatio]="2 / 3"\n (save)="onCoverSaved($event)"\n (deleteImage)="onCoverDeleted()"\n></ui-image-editor>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"usage-overlay",children:"Usage (overlay)"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--overlay",children:"Open story"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-editor\n variant="overlay"\n [active]="editorActive()"\n [imageUrl]="currentCover()"\n [aspectRatio]="2 / 3"\n (save)="onCoverSaved($event)"\n (deleteImage)="onCoverDeleted()"\n (activeOutput)="editorActive.set($event)"\n></ui-image-editor>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"with-an-existing-image",children:"With an existing image"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-2",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--with-image",children:"Open story"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Opening with an image shows it in view mode. The footer offers ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Delete"}),",\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Upload"})," (pick a new file), ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Crop"})," (edit the current image without\nre-uploading), ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Cancel"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Save"}),". Both ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Upload"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Crop"})," switch to\nthe crop stage; ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Save"})," is enabled there."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The crop box works by pointer and by keyboard alike: it is a tab stop, the\narrow keys pan it, Shift with an arrow resizes it from the south-east corner\n— a locked ratio holds exactly as it does for a pointer on that corner. The\nhint under the box says so in the reader's language."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"locked-aspect-ratio",children:"Locked aspect ratio"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-3",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--poster-ratio",children:"Open story"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Passing ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"aspectRatio"})," (e.g. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"2 / 3"})," for a poster) constrains the crop box while\nresizing; the height follows the width automatically. Only the corner handles\nare shown in this mode."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"empty-state",children:"Empty state"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"open-story-4",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--empty",children:"Open story"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Without an ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"imageUrl"})," the editor shows an empty placeholder and only the upload\naction."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"footer-buttons",children:"Footer buttons"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Five icon buttons on one row (grey surface, tinted icons where it helps). Each\ncarries a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"aria-label"})," tooltip. Disabled buttons keep the same grey\nbackground — only their icon is dimmed, in its normal colour, so it stays\nreadable against that surface. The ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/molecules-image-editor--empty",children:"empty state"}),"\nshows this: with no image, Crop, Delete and Save are all disabled."]}),"\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:"Button"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Icon"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Enabled when"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Action"})]})}),(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:"Upload"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"add_a_photo"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"always"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Opens the file picker; a chosen PNG/GIF/JPEG enters the crop stage."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Crop"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"crop"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"an image exists and view mode (not already cropping)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Loads the current image into the crop stage."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Cancel"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"close"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"always"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"In the crop stage with a current image: discards and returns to view. Otherwise closes the overlay (embedded: resets to view)."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Delete (red icon)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"delete"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"an image exists"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Emits ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"deleteImage"})," and closes the overlay (embedded: resets to view)."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Save (green icon when active)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"save"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"crop stage and not converting"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Converts the crop to a JPEG, emits ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"save"}),", closes the overlay (embedded: resets to view)."]})]})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Rejecting a file (wrong type or over the size limit) shows an inline error and\nstays in the current stage."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"inputs",children:"Inputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"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:"variant"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'embedded' | 'overlay'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'embedded'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"In-flow presentation or the ui overlay."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"active"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Opens/closes the overlay (overlay variant only)."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"imageUrl"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"string | null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The current image shown when the editor opens."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"aspectRatio"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number | null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Locks the crop to this width/height ratio; null allows free cropping."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"maxWidth"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"1200"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Maximum output width in pixels; height follows the crop ratio."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"quality"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0.75"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"JPEG quality (0..1) of the converted output."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"maxFileSizeMb"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"10"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Rejects source files larger than this (megabytes)."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"headline"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"string | null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Optional overlay title; falls back to the imageEditor.title key."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"overlayDirection"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'center' | 'top' | 'bottom' | 'left' | 'right' | null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{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:"Side the overlay slides in from (overlay variant only); null keeps the\noverlay's own centre default. Use 'left'/'right' to make the editor a\ndrawer that matches an app's navigation panel."})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"overlayFitContent"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Sizes the overlay to its content instead of the available height\n(overlay variant only) — see the overlay's own fitContent. Keeps a sheet\nholding a small image from standing there as a tall, empty column."})})]})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The overlay variant always runs with the overlay's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"viewportHeight"}),": a sheet\nbelongs to the browser window, not to the document. Without it the percentage\nheights resolve against a transformed ancestor's box, and inside a long page\nthat stretches the sheet to the full document height — header and footer end up\nfar outside the visible area."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h2,{id:"outputs",children:"Outputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.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:"Payload"}),(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:"save"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Blob"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"The converted JPEG when the user saves."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"deleteImage"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"void"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when the user deletes the current image."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"activeOutput"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Forwards the overlay close event (emits false; overlay variant only)."})]})]})]})]})}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)}}}]);
|
package/storybook/molecules-image-editor-image-editor-component-stories.56467f17.iframe.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[8180],{"./libs/ui/src/lib/molecules/image-editor/image-editor.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Empty:()=>Empty,Overlay:()=>Overlay,PosterRatio:()=>PosterRatio,WithImage:()=>WithImage,__namedExportsOrder:()=>__namedExportsOrder,default:()=>image_editor_component_stories});var dist=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),header_component=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),asyncToGenerator=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var image_editor_componentngResource=__webpack_require__("./libs/ui/src/lib/molecules/image-editor/image-editor.component.css?ngResource"),image_editor_componentngResource_default=__webpack_require__.n(image_editor_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"),_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"),fesm2022_forms=__webpack_require__("./node_modules/@angular/forms/fesm2022/forms.mjs"),ngneat_transloco=__webpack_require__("./node_modules/@ngneat/transloco/fesm2022/ngneat-transloco.mjs"),slider_component=__webpack_require__("./libs/ui/src/lib/forms/slider/slider.component.ts"),header_header_component=__webpack_require__("./libs/ui/src/lib/layout/overlay/header/header.component.ts"),overlay_component=__webpack_require__("./libs/ui/src/lib/layout/overlay/overlay.component.ts");var crop_box_componentngResource=__webpack_require__("./libs/ui/src/lib/molecules/image-editor/crop-box/crop-box.component.css?ngResource"),crop_box_componentngResource_default=__webpack_require__.n(crop_box_componentngResource);let UiImageEditorCropBoxComponent=class UiImageEditorCropBoxComponent{src=(0,core.input)("");aspectRatio=(0,core.input)(null);zoom=(0,core.input)(100);cropChange=(0,core.output)();preview=(0,core.viewChild)("preview");cropEl=(0,core.viewChild)("crop");frameEl=(0,core.viewChild)("frame");naturalWidth=(0,_effect_chunk2.vPA)(0);naturalHeight=(0,_effect_chunk2.vPA)(0);cornerHandles=[{h:"nw",cls:"_nw"},{h:"ne",cls:"_ne"},{h:"sw",cls:"_sw"},{h:"se",cls:"_se"}];edgeHandles=[{h:"n",cls:"_n"},{h:"s",cls:"_s"},{h:"w",cls:"_w"},{h:"e",cls:"_e"},{h:"move",cls:"_center"}];handles=(0,_resource_chunk.EW)(()=>this.aspectRatio()?this.cornerHandles:[...this.cornerHandles,...this.edgeHandles]);cropX=(0,_effect_chunk2.vPA)(0);cropY=(0,_effect_chunk2.vPA)(0);cropWidth=(0,_effect_chunk2.vPA)(0);cropHeight=(0,_effect_chunk2.vPA)(0);drag=null;constructor(){(0,_effect_chunk2.QZP)(()=>{this.src(),this.aspectRatio(),(0,_resource_chunk.O8)(()=>{this.naturalWidth()>0&&this.resetCrop()})}),(0,_effect_chunk2.QZP)(()=>this.paint()),(0,_effect_chunk2.QZP)(()=>{const el=this.frameEl()?.nativeElement;el&&(el.style.transform=`scale(${this.zoom()/100})`)})}paint(){const el=this.cropEl()?.nativeElement;el&&(el.style.left=`${this.leftPercent()}%`,el.style.top=`${this.topPercent()}%`,el.style.width=`${this.widthPercent()}%`,el.style.height=`${this.heightPercent()}%`)}onImageLoad(){const img=this.preview()?.nativeElement;img&&(this.naturalWidth.set(img.naturalWidth),this.naturalHeight.set(img.naturalHeight),this.resetCrop())}resetCrop(){const natW=this.naturalWidth(),natH=this.naturalHeight();if(0===natW||0===natH)return;const ratio=this.aspectRatio();let w=natW,h=natH;ratio&&ratio>0&&(natW/natH>ratio?(h=natH,w=h*ratio):(w=natW,h=w/ratio)),this.cropWidth.set(Math.round(w)),this.cropHeight.set(Math.round(h)),this.cropX.set(Math.round((natW-w)/2)),this.cropY.set(Math.round((natH-h)/2)),this.emit()}leftPercent=(0,_resource_chunk.EW)(()=>this.naturalWidth()?this.cropX()/this.naturalWidth()*100:0);topPercent=(0,_resource_chunk.EW)(()=>this.naturalHeight()?this.cropY()/this.naturalHeight()*100:0);widthPercent=(0,_resource_chunk.EW)(()=>this.naturalWidth()?this.cropWidth()/this.naturalWidth()*100:100);heightPercent=(0,_resource_chunk.EW)(()=>this.naturalHeight()?this.cropHeight()/this.naturalHeight()*100:100);onPointerDown(event,handle){event.preventDefault(),event.stopPropagation(),event.target.setPointerCapture(event.pointerId),this.drag={handle,startClientX:event.clientX,startClientY:event.clientY,startX:this.cropX(),startY:this.cropY(),startWidth:this.cropWidth(),startHeight:this.cropHeight()}}onPointerMove(event){if(!this.drag)return;const img=this.preview()?.nativeElement;if(!img)return;const shownWidth=img.getBoundingClientRect().width;if(0===shownWidth)return;const scale=this.naturalWidth()/shownWidth,dx=(event.clientX-this.drag.startClientX)*scale,dy=(event.clientY-this.drag.startClientY)*scale;"move"===this.drag.handle?this.moveBy(dx,dy):this.resizeBy(this.drag.handle,dx,dy),this.paint(),this.emit()}onPointerUp(event){this.drag&&(event.target.releasePointerCapture?.(event.pointerId),this.drag=null,this.emit())}onKeydown(event){const step=Math.max(8,Math.round(.02*this.naturalWidth())),dx="ArrowLeft"===event.key?-step:"ArrowRight"===event.key?step:0,dy="ArrowUp"===event.key?-step:"ArrowDown"===event.key?step:0;0===dx&&0===dy||(event.preventDefault(),this.drag={handle:event.shiftKey?"se":"move",startClientX:0,startClientY:0,startX:this.cropX(),startY:this.cropY(),startWidth:this.cropWidth(),startHeight:this.cropHeight()},event.shiftKey?this.resizeBy("se",dx,dy):this.moveBy(dx,dy),this.drag=null,this.paint(),this.emit())}moveBy(dx,dy){if(!this.drag)return;const natW=this.naturalWidth(),natH=this.naturalHeight(),w=this.drag.startWidth,h=this.drag.startHeight;this.cropX.set(this.clamp(this.drag.startX+dx,0,natW-w)),this.cropY.set(this.clamp(this.drag.startY+dy,0,natH-h))}resizeBy(handle,dx,dy){if(!this.drag)return;const natW=this.naturalWidth(),natH=this.naturalHeight(),ratio=this.aspectRatio(),left0=this.drag.startX,top0=this.drag.startY,right0=left0+this.drag.startWidth,bottom0=top0+this.drag.startHeight,mL="nw"===handle||"sw"===handle||"w"===handle,mR="ne"===handle||"se"===handle||"e"===handle,mT="nw"===handle||"ne"===handle||"n"===handle,mB="sw"===handle||"se"===handle||"s"===handle;let left=mL?this.clamp(left0+dx,0,right0-24):left0,right=mR?this.clamp(right0+dx,left0+24,natW):right0,top=mT?this.clamp(top0+dy,0,bottom0-24):top0,bottom=mB?this.clamp(bottom0+dy,top0+24,natH):bottom0;if(ratio&&ratio>0){const horizontal=mL||mR,vertical=mT||mB;if(horizontal&&!vertical){if(bottom=top+(right-left)/ratio,bottom>natH){bottom=natH;const w=(bottom-top)*ratio;mL?left=right-w:right=left+w}}else if(vertical&&!horizontal){if(right=left+(bottom-top)*ratio,right>natW){right=natW;const h=(right-left)/ratio;mT?top=bottom-h:bottom=top+h}}else{let h=(right-left)/ratio;if(mT){if(top=bottom-h,top<0){top=0,h=bottom;const w=h*ratio;mL?left=right-w:right=left+w}}else if(bottom=top+h,bottom>natH){bottom=natH,h=bottom-top;const w=h*ratio;mL?left=right-w:right=left+w}}}this.cropX.set(Math.round(left)),this.cropY.set(Math.round(top)),this.cropWidth.set(Math.round(right-left)),this.cropHeight.set(Math.round(bottom-top))}emit(){const natW=this.naturalWidth(),natH=this.naturalHeight();0!==natW&&0!==natH&&this.cropChange.emit({x:this.cropX()/natW,y:this.cropY()/natH,width:this.cropWidth()/natW,height:this.cropHeight()/natH})}clamp(value,min,max){return Math.min(Math.max(value,min),max)}static ctorParameters=()=>[];static propDecorators={src:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"src",required:!1,transform:void 0}]}],aspectRatio:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"aspectRatio",required:!1,transform:void 0}]}],zoom:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"zoom",required:!1,transform:void 0}]}],cropChange:[{type:_debug_node_chunk.k7i,args:["cropChange"]}],preview:[{type:core.ViewChild,args:["preview",{isSignal:!0}]}],cropEl:[{type:core.ViewChild,args:["crop",{isSignal:!0}]}],frameEl:[{type:core.ViewChild,args:["frame",{isSignal:!0}]}]}};UiImageEditorCropBoxComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-image-editor-crop-box",template:'<div class="_stage">\n <div #frame class="_frame">\n <img\n #preview\n class="_image"\n [src]="src()"\n alt=""\n draggable="false"\n (load)="onImageLoad()"\n />\n\n @if (naturalWidth() > 0) {\n \x3c!-- Focusable: the crop is operable by keyboard — arrows pan,\n Shift+arrows resize — so it needs a tab stop and a name. --\x3e\n <div\n #crop\n class="_crop"\n tabindex="0"\n role="group"\n [attr.aria-label]="\'imageEditor.cropLabel\' | transloco"\n (keydown)="onKeydown($event)"\n (pointerdown)="onPointerDown($event, \'move\')"\n (pointermove)="onPointerMove($event)"\n (pointerup)="onPointerUp($event)"\n >\n @for (hnd of handles(); track hnd.cls) {\n <span\n class="_handle {{ hnd.cls }}"\n (pointerdown)="onPointerDown($event, hnd.h)"\n (pointermove)="onPointerMove($event)"\n (pointerup)="onPointerUp($event)"\n ></span>\n }\n </div>\n }\n </div>\n</div>\n',encapsulation:_debug_node_chunk.gXe.Emulated,imports:[ngneat_transloco.Kj],styles:[crop_box_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiImageEditorCropBoxComponent);const UI_IMAGE_EDITOR_ACCEPTED_TYPES=["image/png","image/gif","image/jpeg"];let UiImageEditorComponent=class UiImageEditorComponent{variant=(0,core.input)("embedded");active=(0,core.input)(!1);imageUrl=(0,core.input)(null);aspectRatio=(0,core.input)(null);maxWidth=(0,core.input)(1200);quality=(0,core.input)(.75);maxFileSizeMb=(0,core.input)(10);headline=(0,core.input)(null);overlayDirection=(0,core.input)(null);overlayFitContent=(0,core.input)(!1);save=(0,core.output)();deleteImage=(0,core.output)();activeOutput=(0,core.output)();fileInput=(0,core.viewChild)("fileInput");sourceUrl=(0,_effect_chunk2.vPA)(null);crop=(0,_effect_chunk2.vPA)(null);busy=(0,_effect_chunk2.vPA)(!1);errorKey=(0,_effect_chunk2.vPA)(null);zoom=(0,_effect_chunk2.vPA)(100);working=null;stage=(0,_resource_chunk.EW)(()=>this.sourceUrl()?"crop":"view");hasImage=(0,_resource_chunk.EW)(()=>Boolean(this.imageUrl()));canDelete=(0,_resource_chunk.EW)(()=>this.hasImage());canEdit=(0,_resource_chunk.EW)(()=>this.hasImage()&&"view"===this.stage());canSave=(0,_resource_chunk.EW)(()=>"crop"===this.stage()&&!this.busy());acceptAttr=UI_IMAGE_EDITOR_ACCEPTED_TYPES.join(",");constructor(){(0,_effect_chunk2.QZP)(()=>{"overlay"!==this.variant()||this.active()||this.reset()})}openPicker(){this.errorKey.set(null),this.fileInput()?.nativeElement.click()}onFileSelected(event){var _this=this;return(0,asyncToGenerator.A)(function*(){const el=event.target,file=el.files?.[0];if(el.value="",!file)return;if(!UI_IMAGE_EDITOR_ACCEPTED_TYPES.includes(file.type))return void _this.errorKey.set("wrongType");if(file.size>1024*_this.maxFileSizeMb()*1024)return void _this.errorKey.set("tooBig");_this.errorKey.set(null),_this.revokeSource();const url=URL.createObjectURL(file),img=new Image;img.decoding="async",img.src=url;try{yield img.decode()}catch{return URL.revokeObjectURL(url),void _this.errorKey.set("wrongType")}_this.working=img,_this.crop.set(null),_this.sourceUrl.set(url)})()}openEdit(){var _this2=this;return(0,asyncToGenerator.A)(function*(){const url=_this2.imageUrl();if(!url)return;_this2.errorKey.set(null);const img=new Image;img.crossOrigin="anonymous",img.decoding="async",img.src=url;try{yield img.decode()}catch{}_this2.working=img,_this2.crop.set(null),_this2.sourceUrl.set(url)})()}onCropChange(rect){this.crop.set(rect)}onDelete(){this.deleteImage.emit(),this.requestClose()}onCancel(){if("crop"===this.stage()&&this.hasImage())return this.revokeSource(),this.working=null,this.sourceUrl.set(null),void this.crop.set(null);this.requestClose()}runSave(){if(this.busy()||!this.working)return;this.busy.set(!0);const img=this.working,rect=this.crop()??{x:0,y:0,width:1,height:1},sx=rect.x*img.naturalWidth,sy=rect.y*img.naturalHeight,sw=Math.max(1,rect.width*img.naturalWidth),sh=Math.max(1,rect.height*img.naturalHeight),targetW=Math.round(Math.min(sw,this.maxWidth())),targetH=Math.round(sh*(targetW/sw)),canvas=document.createElement("canvas");canvas.width=targetW,canvas.height=targetH;const ctx=canvas.getContext("2d");ctx?(ctx.imageSmoothingQuality="high",ctx.fillStyle="#ffffff",ctx.fillRect(0,0,targetW,targetH),ctx.drawImage(img,sx,sy,sw,sh,0,0,targetW,targetH),canvas.toBlob(blob=>{this.busy.set(!1),blob&&(this.save.emit(blob),this.requestClose())},"image/jpeg",this.quality())):this.busy.set(!1)}onOverlayClose(){this.activeOutput.emit(!1)}requestClose(){"overlay"===this.variant()?this.activeOutput.emit(!1):this.reset()}reset(){this.revokeSource(),this.working=null,this.sourceUrl.set(null),this.crop.set(null),this.busy.set(!1),this.errorKey.set(null),this.zoom.set(100)}revokeSource(){const url=this.sourceUrl();url&&URL.revokeObjectURL(url)}static ctorParameters=()=>[];static propDecorators={variant:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"variant",required:!1,transform:void 0}]}],active:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"active",required:!1,transform:void 0}]}],imageUrl:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"imageUrl",required:!1,transform:void 0}]}],aspectRatio:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"aspectRatio",required:!1,transform:void 0}]}],maxWidth:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"maxWidth",required:!1,transform:void 0}]}],quality:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"quality",required:!1,transform:void 0}]}],maxFileSizeMb:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"maxFileSizeMb",required:!1,transform:void 0}]}],headline:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"headline",required:!1,transform:void 0}]}],overlayDirection:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"overlayDirection",required:!1,transform:void 0}]}],overlayFitContent:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"overlayFitContent",required:!1,transform:void 0}]}],save:[{type:_debug_node_chunk.k7i,args:["save"]}],deleteImage:[{type:_debug_node_chunk.k7i,args:["deleteImage"]}],activeOutput:[{type:_debug_node_chunk.k7i,args:["activeOutput"]}],fileInput:[{type:core.ViewChild,args:["fileInput",{isSignal:!0}]}]}};UiImageEditorComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-image-editor",template:'\x3c!-- Body and footer are defined once and projected into either presentation. --\x3e\n<ng-template #bodyTpl>\n @if (errorKey()) {\n <p class="_error">{{ \'imageEditor.errors.\' + errorKey() | transloco }}</p>\n }\n\n @if (stage() === \'crop\') {\n <ui-image-editor-crop-box\n [src]="sourceUrl() ?? \'\'"\n [aspectRatio]="aspectRatio()"\n [zoom]="zoom()"\n (cropChange)="onCropChange($event)"\n ></ui-image-editor-crop-box>\n <p class="_hint">{{ \'imageEditor.cropHint\' | transloco }}</p>\n <ui-slider class="_zoom" [label]="\'imageEditor.zoom\' | transloco">\n <input\n ui-tag\n type="range"\n class="ui"\n [min]="20"\n [max]="100"\n [step]="1"\n [ngModel]="zoom()"\n (ngModelChange)="zoom.set(+$event)"\n />\n </ui-slider>\n } @else {\n <div class="_view">\n @if (hasImage()) {\n <img class="_current" [src]="imageUrl()" alt="" />\n } @else {\n <div class="_empty">\n <span class="ui-icon x3">image</span>\n <p>{{ \'imageEditor.empty\' | transloco }}</p>\n </div>\n }\n </div>\n }\n\n <input\n #fileInput\n type="file"\n [accept]="acceptAttr"\n hidden\n (change)="onFileSelected($event)"\n />\n</ng-template>\n\n<ng-template #footerTpl>\n <button\n class="ui _upload"\n type="button"\n [title]="\'imageEditor.replace\' | transloco"\n [attr.aria-label]="\'imageEditor.replace\' | transloco"\n (click)="openPicker()"\n >\n <span class="ui-icon">add_a_photo</span>\n </button>\n <button\n class="ui _crop"\n type="button"\n [title]="\'imageEditor.edit\' | transloco"\n [attr.aria-label]="\'imageEditor.edit\' | transloco"\n [disabled]="!canEdit()"\n (click)="openEdit()"\n >\n <span class="ui-icon">crop</span>\n </button>\n <button\n class="ui _cancel"\n type="button"\n [title]="\'actions.cancel\' | transloco"\n [attr.aria-label]="\'actions.cancel\' | transloco"\n (click)="onCancel()"\n >\n <span class="ui-icon">close</span>\n </button>\n <button\n class="ui _delete"\n type="button"\n [title]="\'actions.delete\' | transloco"\n [attr.aria-label]="\'actions.delete\' | transloco"\n [disabled]="!canDelete()"\n (click)="onDelete()"\n >\n <span class="ui-icon">delete</span>\n </button>\n <button\n class="ui _save"\n type="button"\n [title]="\'actions.save\' | transloco"\n [attr.aria-label]="\'actions.save\' | transloco"\n [disabled]="!canSave()"\n (click)="runSave()"\n >\n <span class="ui-icon">save</span>\n </button>\n</ng-template>\n\n@if (variant() === \'overlay\') {\n \x3c!-- viewportHeight: a sheet belongs to the browser window, not to the\n document. Without it the percentage heights are resolved against a\n transformed ancestor\'s box — inside a long page that stretches the sheet\n to the full document height and pushes header and footer out of sight. --\x3e\n <ui-layout-overlay\n [active]="active()"\n [maxWidth]="\'ms-5\'"\n [viewportHeight]="true"\n [fitContent]="overlayFitContent()"\n [direction]="overlayDirection()"\n (activeOutput)="onOverlayClose()"\n >\n <ui-layout-overlay-header\n overlay-header\n [headline]="headline() ?? (\'imageEditor.title\' | transloco)"\n (activeOutput)="onOverlayClose()"\n ></ui-layout-overlay-header>\n\n <div overlay-content class="_body">\n <ng-container [ngTemplateOutlet]="bodyTpl"></ng-container>\n </div>\n\n <div overlay-footer class="_footer">\n <ng-container [ngTemplateOutlet]="footerTpl"></ng-container>\n </div>\n </ui-layout-overlay>\n} @else {\n <div class="_body">\n <ng-container [ngTemplateOutlet]="bodyTpl"></ng-container>\n </div>\n <div class="_footer">\n <ng-container [ngTemplateOutlet]="footerTpl"></ng-container>\n </div>\n}\n',encapsulation:_debug_node_chunk.gXe.Emulated,host:{"[class.embedded]":"variant() === 'embedded'"},imports:[fesm2022_forms.YN,_common_module_chunk.T3,ngneat_transloco.Kj,overlay_component.o,header_header_component.t,UiImageEditorCropBoxComponent,slider_component.H],styles:[image_editor_componentngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiImageEditorComponent);const image_editor_component_stories={title:"Molecules/Image Editor",component:UiImageEditorComponent,decorators:[(0,dist.L4)({providers:[]}),(0,dist.Iz)({imports:[header_component.b,UiImageEditorComponent]})],argTypes:{aspectRatio:{control:{type:"range",min:.5,max:3,step:.05}},maxWidth:{control:"number"},quality:{control:{type:"range",min:.1,max:1,step:.05}},maxFileSizeMb:{control:"number"}},parameters:{docs:{canvas:{sourceState:"none"}}}},embeddedTemplate='\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="flex max-w-2xl flex-col gap-4 p-4">\n <ui-image-editor\n [imageUrl]="imageUrl"\n [aspectRatio]="aspectRatio"\n (save)="onSave($event)"\n (deleteImage)="onDelete()"\n ></ui-image-editor>\n @if (resultUrl) {\n <img class="w-[12rem] rounded" [src]="resultUrl" alt="" />\n }\n </section>\n',props=imageUrl=>({active:!1,imageUrl,resultUrl:null,onSave(blob){this.resultUrl=URL.createObjectURL(blob)},onDelete(){this.imageUrl=null}}),WithImage={render:args=>({props:{...props("assets/ui/images/800x600.png"),...args},template:embeddedTemplate})},PosterRatio={args:{aspectRatio:2/3},render:args=>({props:{...props("assets/ui/images/800x600.png"),...args},template:embeddedTemplate})},Empty={render:args=>({props:{...props(null),...args},template:embeddedTemplate})},Overlay={render:args=>({props:{...props("assets/ui/images/800x600.png"),...args},template:'\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="flex w-fit flex-col gap-4 p-4">\n <button class="ui" (click)="active = true">\n <span class="ui-icon">edit</span>\n </button>\n @if (resultUrl) {\n <img class="w-[12rem] rounded" [src]="resultUrl" alt="" />\n }\n </section>\n <ui-image-editor\n variant="overlay"\n [active]="active"\n [imageUrl]="imageUrl"\n [aspectRatio]="aspectRatio"\n (save)="onSave($event)"\n (deleteImage)="onDelete()"\n (activeOutput)="active = $event"\n ></ui-image-editor>\n'})},__namedExportsOrder=["WithImage","PosterRatio","Empty","Overlay"];WithImage.parameters={...WithImage.parameters,docs:{...WithImage.parameters?.docs,source:{originalSource:"{\n render: args => ({\n props: {\n ...props(uiMoleculeImageEditorMock),\n ...args\n },\n template: embeddedTemplate\n })\n}",...WithImage.parameters?.docs?.source}}},PosterRatio.parameters={...PosterRatio.parameters,docs:{...PosterRatio.parameters?.docs,source:{originalSource:"{\n args: {\n aspectRatio: 2 / 3\n },\n render: args => ({\n props: {\n ...props(uiMoleculeImageEditorMock),\n ...args\n },\n template: embeddedTemplate\n })\n}",...PosterRatio.parameters?.docs?.source}}},Empty.parameters={...Empty.parameters,docs:{...Empty.parameters?.docs,source:{originalSource:"{\n render: args => ({\n props: {\n ...props(null),\n ...args\n },\n template: embeddedTemplate\n })\n}",...Empty.parameters?.docs?.source}}},Overlay.parameters={...Overlay.parameters,docs:{...Overlay.parameters?.docs,source:{originalSource:"{\n render: args => ({\n props: {\n ...props(uiMoleculeImageEditorMock),\n ...args\n },\n template: overlayTemplate\n })\n}",...Overlay.parameters?.docs?.source}}}},"./libs/ui/src/lib/molecules/image-editor/crop-box/crop-box.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: block;\n width: 100%;\n}\n\n/* Centers the frame; clips the zoomed image to the stage. The padding leaves\n room for the edge handles (which straddle the image border) so they render\n fully square instead of being cut off at 100% zoom. */\n._stage {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n /* The image caps the height (max-height below); the stage adds padding on top\n so it must NOT also cap at 60vh, or the padding gets clipped and the edge\n handles are cut off. */\n padding: calc(var(--ui-spacer) * 0.375);\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n touch-action: none;\n}\n\n/* Wraps the image and crop box so both scale together on zoom. Sizes to the\n image, and is the positioning context for the absolutely-placed crop box. */\n._frame {\n position: relative;\n display: inline-block;\n line-height: 0;\n transform-origin: center;\n}\n\n._image {\n display: block;\n max-width: 100%;\n max-height: 60vh;\n object-fit: contain;\n /* Honor EXIF orientation of camera photos. */\n image-orientation: from-image;\n -webkit-user-drag: none;\n}\n\n/* The crop rectangle. The huge spread box-shadow dims everything outside it. */\n._crop {\n position: absolute;\n box-sizing: border-box;\n border: var(--ui-border-width) solid var(--ui-c-static);\n box-shadow: 0 0 0 100vmax rgba(var(--ui-c-background-value), 0.6);\n cursor: move;\n touch-action: none;\n\n /* The crop is a tab stop (arrows pan, Shift+arrows resize). The ring is\n the house focus colour ON TOP of the backdrop shadow — the shadow list\n keeps the dimmed surround, the outline says where the keys will land. */\n &:focus-visible {\n outline: calc(var(--ui-border-width) * 2) solid var(--ui-c-focus);\n outline-offset: calc(var(--ui-border-width) * -1);\n }\n}\n\n/* Rule-of-thirds guides (decorative, non-interactive). */\n._crop::before,\n._crop::after {\n content: '';\n position: absolute;\n pointer-events: none;\n opacity: 0.4;\n}\n._crop::before {\n top: 0;\n bottom: 0;\n left: 33.333%;\n right: 33.333%;\n border-left: 1px solid var(--ui-c-static);\n border-right: 1px solid var(--ui-c-static);\n}\n._crop::after {\n left: 0;\n right: 0;\n top: 33.333%;\n bottom: 33.333%;\n border-top: 1px solid var(--ui-c-static);\n border-bottom: 1px solid var(--ui-c-static);\n}\n\n._handle {\n position: absolute;\n width: calc(var(--ui-spacer) * 0.5);\n height: calc(var(--ui-spacer) * 0.5);\n background-color: var(--ui-c-static);\n border: 1px solid rgba(var(--ui-c-background-value), 0.8);\n touch-action: none;\n}\n\n._handle._nw {\n top: calc(var(--ui-spacer) * -0.25);\n left: calc(var(--ui-spacer) * -0.25);\n cursor: nwse-resize;\n}\n._handle._ne {\n top: calc(var(--ui-spacer) * -0.25);\n right: calc(var(--ui-spacer) * -0.25);\n cursor: nesw-resize;\n}\n._handle._sw {\n bottom: calc(var(--ui-spacer) * -0.25);\n left: calc(var(--ui-spacer) * -0.25);\n cursor: nesw-resize;\n}\n._handle._se {\n bottom: calc(var(--ui-spacer) * -0.25);\n right: calc(var(--ui-spacer) * -0.25);\n cursor: nwse-resize;\n}\n\n/* Edge midpoint handles. */\n._handle._n {\n top: calc(var(--ui-spacer) * -0.25);\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n._handle._s {\n bottom: calc(var(--ui-spacer) * -0.25);\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n._handle._w {\n left: calc(var(--ui-spacer) * -0.25);\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n._handle._e {\n right: calc(var(--ui-spacer) * -0.25);\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n\n/* Centre grip: pans the whole box; rounded to read as a move target. */\n._handle._center {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n cursor: move;\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/molecules/image-editor/image-editor.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: contents;\n}\n\n/* Embedded variant: a normal block in the document flow. It fills the width it\n is given — the maximum width is set by the consumer from outside; the\n minimum emerges from the footer button row (flex-wrap as safety net). */\n:host(.embedded) {\n display: flex;\n flex-direction: column;\n gap: calc(var(--ui-spacer) * 0.5);\n width: 100%;\n}\n\n/* Embedded: no overlay edge to align to — the buttons sit centered. */\n:host(.embedded) ._footer {\n justify-content: center;\n}\n\n._body {\n display: flex;\n flex-direction: column;\n gap: calc(var(--ui-spacer) * 0.5);\n width: 100%;\n}\n\n/* Rejection notice (wrong type / too big) — filled warn box like the app errors. */\n._error {\n margin: 0;\n padding: calc(var(--ui-spacer) * 0.25) calc(var(--ui-spacer) * 0.5);\n background-color: var(--ui-c-warn);\n color: var(--ui-c-static);\n border-radius: var(--ui-border-radius);\n}\n\n._hint {\n margin: 0;\n text-align: center;\n color: var(--ui-c-default);\n opacity: 0.75;\n}\n\n/* View mode: current cover or an empty placeholder. */\n._view {\n display: flex;\n justify-content: center;\n}\n\n._current {\n display: block;\n max-width: 100%;\n max-height: 60vh;\n object-fit: contain;\n border-radius: var(--ui-border-radius);\n image-orientation: from-image;\n}\n\n._empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n /* Centred in a placeholder area that keeps some surface: without a minimum\n the editor collapses to a flat strip when there is no image yet, which\n looks broken next to the same editor holding a picture. Consumers can\n give it a concrete shape (e.g. an aspect-ratio) on top of this. */\n justify-content: center;\n min-height: 16rem;\n gap: calc(var(--ui-spacer) * 0.25);\n padding: calc(var(--ui-spacer) * 2);\n color: var(--ui-c-default);\n opacity: 0.6;\n}\n\n._empty p {\n margin: 0;\n}\n\n/* Footer button row, right-aligned like the overlay Save example. */\n._footer {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: calc(var(--ui-spacer) * 0.5);\n width: 100%;\n}\n\n._footer button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n/* Keep the grey surface identical when disabled (the base :disabled style swaps\n it for the page background); the disabled state is signalled by dimming just\n the icon, in its normal colour.\n The base :disabled rule pairs that surface swap with `color: --ui-c-fourthly`\n for the text. Restoring only the background — to the same --ui-c-fourthly the\n grey surface uses — would leave the icon tinted the exact colour it sits on,\n so it disappears (tickets#247). Restore the icon\'s normal colour as well; the\n per-action tints below (delete red, save green while active) still override\n it, and `opacity` alone carries the "disabled" signal. */\n._footer button:disabled {\n background-color: var(--ui-c-fourthly);\n color: var(--ui-c-default);\n}\n._footer button:disabled .ui-icon {\n opacity: 0.4;\n}\n\n/* Grey buttons (the base `.ui` surface); only delete and save are tinted per\n action using the shared design tokens — upload, crop and cancel stay neutral. */\n._footer ._delete .ui-icon {\n color: var(--ui-c-error);\n}\n/* Green only while the save action is available; disabled falls back to the\n neutral (dimmed) icon colour. */\n._footer ._save:not(:disabled) .ui-icon {\n color: var(--ui-c-success);\n}\n}\n',""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
|