@newtone-dev/ui-react-web 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-frame/app-frame.css +1026 -0
- package/dist/app-frame/app-frame.d.ts +62 -0
- package/dist/app-frame/app-frame.d.ts.map +1 -0
- package/dist/app-frame/app-frame.js +47 -0
- package/dist/app-frame/app-frame.js.map +1 -0
- package/dist/{desktop → app-frame}/control/control.d.ts +3 -2
- package/dist/app-frame/control/control.d.ts.map +1 -0
- package/dist/{desktop → app-frame}/control/control.js +6 -5
- package/dist/app-frame/control/control.js.map +1 -0
- package/dist/app-frame/index.d.ts +12 -0
- package/dist/app-frame/index.d.ts.map +1 -0
- package/dist/app-frame/index.js +4 -0
- package/dist/app-frame/index.js.map +1 -0
- package/dist/{desktop → app-frame}/launcher/launcher.d.ts +13 -9
- package/dist/app-frame/launcher/launcher.d.ts.map +1 -0
- package/dist/app-frame/launcher/launcher.js +166 -0
- package/dist/app-frame/launcher/launcher.js.map +1 -0
- package/dist/app-frame/main-menu/main-menu.d.ts +34 -0
- package/dist/app-frame/main-menu/main-menu.d.ts.map +1 -0
- package/dist/app-frame/main-menu/main-menu.js +185 -0
- package/dist/app-frame/main-menu/main-menu.js.map +1 -0
- package/dist/{desktop → app-frame}/menu/menu.d.ts +4 -3
- package/dist/app-frame/menu/menu.d.ts.map +1 -0
- package/dist/{desktop → app-frame}/menu/menu.js +6 -4
- package/dist/app-frame/menu/menu.js.map +1 -0
- package/dist/app-frame/monogram/monogram.d.ts.map +1 -0
- package/dist/app-frame/monogram/monogram.js +15 -0
- package/dist/app-frame/monogram/monogram.js.map +1 -0
- package/dist/{desktop → app-frame}/panel/panel.d.ts +3 -3
- package/dist/app-frame/panel/panel.d.ts.map +1 -0
- package/dist/{desktop → app-frame}/panel/panel.js +2 -2
- package/dist/app-frame/panel/panel.js.map +1 -0
- package/dist/app-frame/parts.d.ts +177 -0
- package/dist/app-frame/parts.d.ts.map +1 -0
- package/dist/app-frame/parts.js +119 -0
- package/dist/app-frame/parts.js.map +1 -0
- package/dist/{desktop → app-frame}/sheet/sheet.d.ts +3 -3
- package/dist/app-frame/sheet/sheet.d.ts.map +1 -0
- package/dist/app-frame/sheet/sheet.js +10 -0
- package/dist/app-frame/sheet/sheet.js.map +1 -0
- package/dist/{desktop → app-frame}/widget/widget.d.ts +8 -8
- package/dist/app-frame/widget/widget.d.ts.map +1 -0
- package/dist/app-frame/widget/widget.js +18 -0
- package/dist/app-frame/widget/widget.js.map +1 -0
- package/dist/ask-button/ask-button.css +37 -0
- package/dist/ask-button/ask-button.d.ts +24 -0
- package/dist/ask-button/ask-button.d.ts.map +1 -0
- package/dist/ask-button/ask-button.js +19 -0
- package/dist/ask-button/ask-button.js.map +1 -0
- package/dist/ask-button/index.d.ts +3 -0
- package/dist/ask-button/index.d.ts.map +1 -0
- package/dist/ask-button/index.js +2 -0
- package/dist/ask-button/index.js.map +1 -0
- package/dist/avatar/avatar.css +65 -0
- package/dist/avatar/avatar.d.ts +12 -1
- package/dist/avatar/avatar.d.ts.map +1 -1
- package/dist/avatar/avatar.js +3 -3
- package/dist/avatar/avatar.js.map +1 -1
- package/dist/backlinks/backlinks.css +6 -0
- package/dist/backlinks/backlinks.d.ts +28 -0
- package/dist/backlinks/backlinks.d.ts.map +1 -0
- package/dist/backlinks/backlinks.js +13 -0
- package/dist/backlinks/backlinks.js.map +1 -0
- package/dist/backlinks/index.d.ts +3 -0
- package/dist/backlinks/index.d.ts.map +1 -0
- package/dist/backlinks/index.js +2 -0
- package/dist/backlinks/index.js.map +1 -0
- package/dist/badge/badge.css +44 -0
- package/dist/badge/badge.d.ts +16 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/badge.js +15 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/below/below.css +214 -0
- package/dist/below/below.d.ts +61 -0
- package/dist/below/below.d.ts.map +1 -0
- package/dist/below/below.js +106 -0
- package/dist/below/below.js.map +1 -0
- package/dist/below/grip.d.ts +20 -0
- package/dist/below/grip.d.ts.map +1 -0
- package/dist/below/grip.js +78 -0
- package/dist/below/grip.js.map +1 -0
- package/dist/below/index.d.ts +3 -0
- package/dist/below/index.d.ts.map +1 -0
- package/dist/below/index.js +2 -0
- package/dist/below/index.js.map +1 -0
- package/dist/below/room.d.ts +2 -0
- package/dist/below/room.d.ts.map +1 -0
- package/dist/below/room.js +6 -0
- package/dist/below/room.js.map +1 -0
- package/dist/beside/beside.css +68 -4
- package/dist/beside/beside.d.ts +8 -1
- package/dist/beside/beside.d.ts.map +1 -1
- package/dist/beside/beside.js +2 -2
- package/dist/beside/beside.js.map +1 -1
- package/dist/canvas/box/box.d.ts +9 -2
- package/dist/canvas/box/box.d.ts.map +1 -1
- package/dist/canvas/box/box.js +8 -4
- package/dist/canvas/box/box.js.map +1 -1
- package/dist/canvas/canvas.css +411 -8
- package/dist/canvas/canvas.d.ts +57 -8
- package/dist/canvas/canvas.d.ts.map +1 -1
- package/dist/canvas/canvas.js +166 -13
- package/dist/canvas/canvas.js.map +1 -1
- package/dist/canvas/cells/cells.d.ts +17 -0
- package/dist/canvas/cells/cells.d.ts.map +1 -0
- package/dist/canvas/cells/cells.js +24 -0
- package/dist/canvas/cells/cells.js.map +1 -0
- package/dist/canvas/cells/grid.d.ts +84 -0
- package/dist/canvas/cells/grid.d.ts.map +1 -0
- package/dist/canvas/cells/grid.js +170 -0
- package/dist/canvas/cells/grid.js.map +1 -0
- package/dist/canvas/context.d.ts +16 -0
- package/dist/canvas/context.d.ts.map +1 -1
- package/dist/canvas/context.js.map +1 -1
- package/dist/canvas/dock/dock.d.ts +25 -0
- package/dist/canvas/dock/dock.d.ts.map +1 -0
- package/dist/canvas/dock/dock.js +60 -0
- package/dist/canvas/dock/dock.js.map +1 -0
- package/dist/canvas/edit/edit.d.ts +40 -0
- package/dist/canvas/edit/edit.d.ts.map +1 -0
- package/dist/canvas/edit/edit.js +66 -0
- package/dist/canvas/edit/edit.js.map +1 -0
- package/dist/canvas/edit/rich.d.ts +105 -0
- package/dist/canvas/edit/rich.d.ts.map +1 -0
- package/dist/canvas/edit/rich.js +694 -0
- package/dist/canvas/edit/rich.js.map +1 -0
- package/dist/canvas/frame/frame.d.ts +15 -4
- package/dist/canvas/frame/frame.d.ts.map +1 -1
- package/dist/canvas/frame/frame.js +20 -8
- package/dist/canvas/frame/frame.js.map +1 -1
- package/dist/canvas/heading/heading.d.ts +17 -0
- package/dist/canvas/heading/heading.d.ts.map +1 -0
- package/dist/canvas/heading/heading.js +18 -0
- package/dist/canvas/heading/heading.js.map +1 -0
- package/dist/canvas/index.d.ts +13 -1
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas/index.js +2 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/insert/insert.d.ts +18 -0
- package/dist/canvas/insert/insert.d.ts.map +1 -0
- package/dist/canvas/insert/insert.js +40 -0
- package/dist/canvas/insert/insert.js.map +1 -0
- package/dist/canvas/mark/mark.d.ts +24 -0
- package/dist/canvas/mark/mark.d.ts.map +1 -0
- package/dist/canvas/mark/mark.js +20 -0
- package/dist/canvas/mark/mark.js.map +1 -0
- package/dist/canvas/pin/pin.d.ts +24 -0
- package/dist/canvas/pin/pin.d.ts.map +1 -0
- package/dist/canvas/pin/pin.js +52 -0
- package/dist/canvas/pin/pin.js.map +1 -0
- package/dist/canvas/presence/presence.d.ts +16 -0
- package/dist/canvas/presence/presence.d.ts.map +1 -0
- package/dist/canvas/presence/presence.js +14 -0
- package/dist/canvas/presence/presence.js.map +1 -0
- package/dist/card-box/card-box.css +8 -8
- package/dist/card-box/card-box.d.ts +1 -1
- package/dist/card-box/card-box.d.ts.map +1 -1
- package/dist/chat/chat.css +2 -7
- package/dist/chat/chat.d.ts +5 -3
- package/dist/chat/chat.d.ts.map +1 -1
- package/dist/chat/chat.js +17 -24
- package/dist/chat/chat.js.map +1 -1
- package/dist/color/seeds.js +2 -2
- package/dist/color/seeds.js.map +1 -1
- package/dist/data-grid/data-grid.css +128 -0
- package/dist/data-grid/data-grid.d.ts +45 -0
- package/dist/data-grid/data-grid.d.ts.map +1 -0
- package/dist/data-grid/data-grid.js +50 -0
- package/dist/data-grid/data-grid.js.map +1 -0
- package/dist/data-grid/index.d.ts +3 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/discover/discover.css +60 -0
- package/dist/discover/discover.d.ts +33 -0
- package/dist/discover/discover.d.ts.map +1 -0
- package/dist/discover/discover.js +13 -0
- package/dist/discover/discover.js.map +1 -0
- package/dist/discover/index.d.ts +4 -0
- package/dist/discover/index.d.ts.map +1 -0
- package/dist/discover/index.js +3 -0
- package/dist/discover/index.js.map +1 -0
- package/dist/document/document.css +74 -0
- package/dist/document/document.d.ts +31 -0
- package/dist/document/document.d.ts.map +1 -0
- package/dist/document/document.js +106 -0
- package/dist/document/document.js.map +1 -0
- package/dist/document/index.d.ts +5 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +3 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/wiki-links.d.ts +29 -0
- package/dist/document/wiki-links.d.ts.map +1 -0
- package/dist/document/wiki-links.js +66 -0
- package/dist/document/wiki-links.js.map +1 -0
- package/dist/faces/faces.css +82 -0
- package/dist/faces/faces.d.ts +29 -0
- package/dist/faces/faces.d.ts.map +1 -0
- package/dist/faces/faces.js +21 -0
- package/dist/faces/faces.js.map +1 -0
- package/dist/faces/index.d.ts +4 -0
- package/dist/faces/index.d.ts.map +1 -0
- package/dist/faces/index.js +3 -0
- package/dist/faces/index.js.map +1 -0
- package/dist/file-grid/file-grid.css +56 -1
- package/dist/file-grid/file-grid.d.ts +39 -4
- package/dist/file-grid/file-grid.d.ts.map +1 -1
- package/dist/file-grid/file-grid.js +45 -5
- package/dist/file-grid/file-grid.js.map +1 -1
- package/dist/file-grid/index.d.ts +1 -1
- package/dist/file-grid/index.d.ts.map +1 -1
- package/dist/floating-bar/floating-bar.css +379 -0
- package/dist/floating-bar/floating-bar.d.ts +186 -0
- package/dist/floating-bar/floating-bar.d.ts.map +1 -0
- package/dist/floating-bar/floating-bar.js +278 -0
- package/dist/floating-bar/floating-bar.js.map +1 -0
- package/dist/floating-bar/index.d.ts +3 -0
- package/dist/floating-bar/index.d.ts.map +1 -0
- package/dist/floating-bar/index.js +2 -0
- package/dist/floating-bar/index.js.map +1 -0
- package/dist/floating-bar/menu.d.ts +59 -0
- package/dist/floating-bar/menu.d.ts.map +1 -0
- package/dist/floating-bar/menu.js +149 -0
- package/dist/floating-bar/menu.js.map +1 -0
- package/dist/floating-bar/room.d.ts +2 -0
- package/dist/floating-bar/room.d.ts.map +1 -0
- package/dist/floating-bar/room.js +5 -0
- package/dist/floating-bar/room.js.map +1 -0
- package/dist/font-picker/font-picker.css +39 -0
- package/dist/font-picker/font-picker.d.ts +29 -0
- package/dist/font-picker/font-picker.d.ts.map +1 -0
- package/dist/font-picker/font-picker.js +119 -0
- package/dist/font-picker/font-picker.js.map +1 -0
- package/dist/font-picker/index.d.ts +3 -0
- package/dist/font-picker/index.d.ts.map +1 -0
- package/dist/font-picker/index.js +2 -0
- package/dist/font-picker/index.js.map +1 -0
- package/dist/framed-icon/framed-icon.css +18 -18
- package/dist/framed-icon/framed-icon.d.ts +1 -1
- package/dist/framed-icon/framed-icon.d.ts.map +1 -1
- package/dist/hint/hint.css +55 -0
- package/dist/hint/hint.d.ts +33 -0
- package/dist/hint/hint.d.ts.map +1 -0
- package/dist/hint/hint.js +80 -0
- package/dist/hint/hint.js.map +1 -0
- package/dist/hint/index.d.ts +4 -0
- package/dist/hint/index.d.ts.map +1 -0
- package/dist/hint/index.js +3 -0
- package/dist/hint/index.js.map +1 -0
- package/dist/index.d.ts +59 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.d.ts +3 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +2 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspector/inspector.css +219 -0
- package/dist/inspector/inspector.d.ts +131 -0
- package/dist/inspector/inspector.d.ts.map +1 -0
- package/dist/inspector/inspector.js +68 -0
- package/dist/inspector/inspector.js.map +1 -0
- package/dist/look-picker/index.d.ts +3 -0
- package/dist/look-picker/index.d.ts.map +1 -0
- package/dist/look-picker/index.js +2 -0
- package/dist/look-picker/index.js.map +1 -0
- package/dist/look-picker/look-picker.css +90 -0
- package/dist/look-picker/look-picker.d.ts +40 -0
- package/dist/look-picker/look-picker.d.ts.map +1 -0
- package/dist/look-picker/look-picker.js +82 -0
- package/dist/look-picker/look-picker.js.map +1 -0
- package/dist/look-thumb/index.d.ts +3 -0
- package/dist/look-thumb/index.d.ts.map +1 -0
- package/dist/look-thumb/index.js +2 -0
- package/dist/look-thumb/index.js.map +1 -0
- package/dist/look-thumb/look-thumb.css +7 -0
- package/dist/look-thumb/look-thumb.d.ts +27 -0
- package/dist/look-thumb/look-thumb.d.ts.map +1 -0
- package/dist/look-thumb/look-thumb.js +15 -0
- package/dist/look-thumb/look-thumb.js.map +1 -0
- package/dist/material/index.d.ts +3 -0
- package/dist/material/index.d.ts.map +1 -0
- package/dist/material/index.js +2 -0
- package/dist/material/index.js.map +1 -0
- package/dist/material/material.css +306 -0
- package/dist/material/material.d.ts +43 -0
- package/dist/material/material.d.ts.map +1 -0
- package/dist/material/material.js +27 -0
- package/dist/material/material.js.map +1 -0
- package/dist/on-media/on-media.css +6 -6
- package/dist/page-editor/blocks.d.ts +28 -0
- package/dist/page-editor/blocks.d.ts.map +1 -0
- package/dist/page-editor/blocks.js +206 -0
- package/dist/page-editor/blocks.js.map +1 -0
- package/dist/page-editor/index.d.ts +5 -0
- package/dist/page-editor/index.d.ts.map +1 -0
- package/dist/page-editor/index.js +3 -0
- package/dist/page-editor/index.js.map +1 -0
- package/dist/page-editor/page-editor.css +160 -0
- package/dist/page-editor/page-editor.d.ts +52 -0
- package/dist/page-editor/page-editor.d.ts.map +1 -0
- package/dist/page-editor/page-editor.js +474 -0
- package/dist/page-editor/page-editor.js.map +1 -0
- package/dist/prompt-field/index.d.ts +3 -0
- package/dist/prompt-field/index.d.ts.map +1 -0
- package/dist/prompt-field/index.js +2 -0
- package/dist/prompt-field/index.js.map +1 -0
- package/dist/prompt-field/prompt-field.css +203 -0
- package/dist/prompt-field/prompt-field.d.ts +72 -0
- package/dist/prompt-field/prompt-field.d.ts.map +1 -0
- package/dist/prompt-field/prompt-field.js +91 -0
- package/dist/prompt-field/prompt-field.js.map +1 -0
- package/dist/quick-action/index.d.ts +1 -1
- package/dist/quick-action/index.d.ts.map +1 -1
- package/dist/quick-action/quick-action.css +60 -17
- package/dist/quick-action/quick-action.d.ts +34 -28
- package/dist/quick-action/quick-action.d.ts.map +1 -1
- package/dist/quick-action/quick-action.js +25 -21
- package/dist/quick-action/quick-action.js.map +1 -1
- package/dist/row-list/row-list.css +3 -0
- package/dist/seed-color-field/index.d.ts +3 -0
- package/dist/seed-color-field/index.d.ts.map +1 -0
- package/dist/seed-color-field/index.js +2 -0
- package/dist/seed-color-field/index.js.map +1 -0
- package/dist/seed-color-field/seed-color-field.css +105 -0
- package/dist/seed-color-field/seed-color-field.d.ts +36 -0
- package/dist/seed-color-field/seed-color-field.d.ts.map +1 -0
- package/dist/seed-color-field/seed-color-field.js +103 -0
- package/dist/seed-color-field/seed-color-field.js.map +1 -0
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.css +84 -0
- package/dist/skeleton/skeleton.d.ts +50 -0
- package/dist/skeleton/skeleton.d.ts.map +1 -0
- package/dist/skeleton/skeleton.js +25 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/slide-list/index.d.ts +3 -0
- package/dist/slide-list/index.d.ts.map +1 -0
- package/dist/slide-list/index.js +2 -0
- package/dist/slide-list/index.js.map +1 -0
- package/dist/slide-list/slide-list.css +477 -0
- package/dist/slide-list/slide-list.d.ts +161 -0
- package/dist/slide-list/slide-list.d.ts.map +1 -0
- package/dist/slide-list/slide-list.js +657 -0
- package/dist/slide-list/slide-list.js.map +1 -0
- package/dist/split/index.d.ts +1 -1
- package/dist/split/index.d.ts.map +1 -1
- package/dist/split/split.css +396 -0
- package/dist/split/split.d.ts +60 -1
- package/dist/split/split.d.ts.map +1 -1
- package/dist/split/split.js +30 -3
- package/dist/split/split.js.map +1 -1
- package/dist/stage/index.d.ts +3 -0
- package/dist/stage/index.d.ts.map +1 -0
- package/dist/stage/index.js +2 -0
- package/dist/stage/index.js.map +1 -0
- package/dist/stage/stage.css +139 -0
- package/dist/stage/stage.d.ts +68 -0
- package/dist/stage/stage.d.ts.map +1 -0
- package/dist/stage/stage.js +279 -0
- package/dist/stage/stage.js.map +1 -0
- package/dist/text-diff/diff-lines.d.ts +23 -0
- package/dist/text-diff/diff-lines.d.ts.map +1 -0
- package/dist/text-diff/diff-lines.js +105 -0
- package/dist/text-diff/diff-lines.js.map +1 -0
- package/dist/text-diff/index.d.ts +5 -0
- package/dist/text-diff/index.d.ts.map +1 -0
- package/dist/text-diff/index.js +3 -0
- package/dist/text-diff/index.js.map +1 -0
- package/dist/text-diff/text-diff.css +60 -0
- package/dist/text-diff/text-diff.d.ts +26 -0
- package/dist/text-diff/text-diff.d.ts.map +1 -0
- package/dist/text-diff/text-diff.js +27 -0
- package/dist/text-diff/text-diff.js.map +1 -0
- package/dist/thread/index.d.ts +3 -0
- package/dist/thread/index.d.ts.map +1 -0
- package/dist/thread/index.js +2 -0
- package/dist/thread/index.js.map +1 -0
- package/dist/thread/thread.css +178 -0
- package/dist/thread/thread.d.ts +76 -0
- package/dist/thread/thread.d.ts.map +1 -0
- package/dist/thread/thread.js +147 -0
- package/dist/thread/thread.js.map +1 -0
- package/dist/tile-picker/index.d.ts +3 -0
- package/dist/tile-picker/index.d.ts.map +1 -0
- package/dist/tile-picker/index.js +2 -0
- package/dist/tile-picker/index.js.map +1 -0
- package/dist/tile-picker/tile-picker.css +93 -0
- package/dist/tile-picker/tile-picker.d.ts +37 -0
- package/dist/tile-picker/tile-picker.d.ts.map +1 -0
- package/dist/tile-picker/tile-picker.js +62 -0
- package/dist/tile-picker/tile-picker.js.map +1 -0
- package/dist/version-trail/index.d.ts +3 -0
- package/dist/version-trail/index.d.ts.map +1 -0
- package/dist/version-trail/index.js +2 -0
- package/dist/version-trail/index.js.map +1 -0
- package/dist/version-trail/version-trail.css +62 -0
- package/dist/version-trail/version-trail.d.ts +38 -0
- package/dist/version-trail/version-trail.d.ts.map +1 -0
- package/dist/version-trail/version-trail.js +22 -0
- package/dist/version-trail/version-trail.js.map +1 -0
- package/dist/workbench/index.d.ts +3 -0
- package/dist/workbench/index.d.ts.map +1 -0
- package/dist/workbench/index.js +2 -0
- package/dist/workbench/index.js.map +1 -0
- package/dist/workbench/workbench.css +248 -0
- package/dist/workbench/workbench.d.ts +51 -0
- package/dist/workbench/workbench.d.ts.map +1 -0
- package/dist/workbench/workbench.js +13 -0
- package/dist/workbench/workbench.js.map +1 -0
- package/package.json +133 -7
- package/dist/desktop/bar/apps.d.ts +0 -18
- package/dist/desktop/bar/apps.d.ts.map +0 -1
- package/dist/desktop/bar/apps.js +0 -16
- package/dist/desktop/bar/apps.js.map +0 -1
- package/dist/desktop/bar/bar.d.ts +0 -56
- package/dist/desktop/bar/bar.d.ts.map +0 -1
- package/dist/desktop/bar/bar.js +0 -34
- package/dist/desktop/bar/bar.js.map +0 -1
- package/dist/desktop/bar/monogram.d.ts.map +0 -1
- package/dist/desktop/bar/monogram.js +0 -15
- package/dist/desktop/bar/monogram.js.map +0 -1
- package/dist/desktop/context.d.ts +0 -17
- package/dist/desktop/context.d.ts.map +0 -1
- package/dist/desktop/context.js +0 -10
- package/dist/desktop/context.js.map +0 -1
- package/dist/desktop/control/control.d.ts.map +0 -1
- package/dist/desktop/control/control.js.map +0 -1
- package/dist/desktop/desktop.css +0 -1058
- package/dist/desktop/desktop.d.ts +0 -72
- package/dist/desktop/desktop.d.ts.map +0 -1
- package/dist/desktop/desktop.js +0 -70
- package/dist/desktop/desktop.js.map +0 -1
- package/dist/desktop/index.d.ts +0 -16
- package/dist/desktop/index.d.ts.map +0 -1
- package/dist/desktop/index.js +0 -5
- package/dist/desktop/index.js.map +0 -1
- package/dist/desktop/launcher/launcher.d.ts.map +0 -1
- package/dist/desktop/launcher/launcher.js +0 -164
- package/dist/desktop/launcher/launcher.js.map +0 -1
- package/dist/desktop/menu/menu.d.ts.map +0 -1
- package/dist/desktop/menu/menu.js.map +0 -1
- package/dist/desktop/panel/panel.d.ts.map +0 -1
- package/dist/desktop/panel/panel.js.map +0 -1
- package/dist/desktop/profile/profile.d.ts +0 -38
- package/dist/desktop/profile/profile.d.ts.map +0 -1
- package/dist/desktop/profile/profile.js +0 -18
- package/dist/desktop/profile/profile.js.map +0 -1
- package/dist/desktop/sheet/sheet.d.ts.map +0 -1
- package/dist/desktop/sheet/sheet.js +0 -10
- package/dist/desktop/sheet/sheet.js.map +0 -1
- package/dist/desktop/tiles/layout.d.ts +0 -86
- package/dist/desktop/tiles/layout.d.ts.map +0 -1
- package/dist/desktop/tiles/layout.js +0 -215
- package/dist/desktop/tiles/layout.js.map +0 -1
- package/dist/desktop/tiles/tiles.d.ts +0 -106
- package/dist/desktop/tiles/tiles.d.ts.map +0 -1
- package/dist/desktop/tiles/tiles.js +0 -121
- package/dist/desktop/tiles/tiles.js.map +0 -1
- package/dist/desktop/widget/widget.d.ts.map +0 -1
- package/dist/desktop/widget/widget.js +0 -18
- package/dist/desktop/widget/widget.js.map +0 -1
- /package/dist/{desktop/bar → app-frame/monogram}/monogram.d.ts +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/* Material -- blueprint components/material.md, contract contracts/material.md. What a part is made of (Joshua
|
|
2
|
+
* 2026-11-11): glass, the translucent control layer; crystal, the inset screen content sits on; solid, the default.
|
|
3
|
+
*
|
|
4
|
+
* THIS IS THE ONLY SHEET THAT NAMES `material.*`, `blur.*`, `shadow.close`, `shadow.far` OR `backdrop-filter`
|
|
5
|
+
* (on-media keeps its own vocabulary for photographs). A part never draws glass itself: it wears a recipe class, and
|
|
6
|
+
* the class does nothing outside a glass boundary.
|
|
7
|
+
*
|
|
8
|
+
* WHERE IT APPLIES IS SET BY THE BOUNDARY, NOT BY WHERE A PART SITS. A boundary is `data-newtone-material` on an
|
|
9
|
+
* element (`<Material>`, or a part that is one by what it is: Canvas.Dock, a Workbench foot). Every glass rule sits in
|
|
10
|
+
* one `@scope` from a glass boundary down to the next boundary of another material, so the nearest one wins and a
|
|
11
|
+
* `solid` one (an Inspector, a FloatingBar.Panel) ends the glass above it. `:where(:scope, *)` lets a rule match the
|
|
12
|
+
* boundary itself as well as what is under it, at no specificity of its own.
|
|
13
|
+
*
|
|
14
|
+
* THE FOUR RECIPES (Joshua 2026-11-11):
|
|
15
|
+
* --bar a FloatingBar pill: glass.regular (surface.secondary at 72%), blur.regular (16px), the lit edge, close
|
|
16
|
+
* --menu a menu over the glass: glass.thick (surface.primary at 84%), blur.thick (24px), the lit edge, close + far
|
|
17
|
+
* --field the prompt field: glass.regular, no edge, no shadow; solid while focused
|
|
18
|
+
* --action the raised primary: glass.accent (the primary fill at 88%), blur.regular, the lit edge, close
|
|
19
|
+
* A QuickAction on the glass is raised: `primary` wears --action; `neutral` the bar's wash, edge and shadow, with the
|
|
20
|
+
* glass's veils for hover and press (Joshua 2026-11-11).
|
|
21
|
+
*
|
|
22
|
+
* Private properties are spelled --_material-*. */
|
|
23
|
+
|
|
24
|
+
.newtone-material {
|
|
25
|
+
display: contents;
|
|
26
|
+
}
|
|
27
|
+
/* A crystal boundary is a screen, so it has a box to draw on (Joshua 2026-11-11): the bezel, the ground and the inset
|
|
28
|
+
* shadow need one. Glass and solid stay boxless, safe in a flex row. The consumer sizes it. */
|
|
29
|
+
.newtone-material[data-newtone-material='crystal'] {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* The shadows, cast in black (material.cast, Joshua 2026-11-11), so they read as shadows in dark mode too, where the
|
|
34
|
+
* ink-tinted `raised` read as a glow. Written where a boundary is, and inherited.
|
|
35
|
+
* close the contact (y1 b2 s1 at 10%) under the ambient (y2 b4 s2 at 5%): the bars' and the slide's
|
|
36
|
+
* far y12 b32 at 12%: what a menu adds, standing further off */
|
|
37
|
+
[data-newtone-material],
|
|
38
|
+
.newtone-material-cast-close {
|
|
39
|
+
--_material-contact: 0 var(--newtone-shadow-close-contact-y) var(--newtone-shadow-close-contact-blur) var(--newtone-shadow-close-contact-spread)
|
|
40
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-contact), transparent);
|
|
41
|
+
--_material-close:
|
|
42
|
+
0 var(--newtone-shadow-close-ambient-y) var(--newtone-shadow-close-ambient-blur) var(--newtone-shadow-close-ambient-spread)
|
|
43
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-ambient), transparent),
|
|
44
|
+
var(--_material-contact);
|
|
45
|
+
--_material-far: 0 var(--newtone-shadow-far-ambient-y) var(--newtone-shadow-far-ambient-blur) var(--newtone-shadow-far-ambient-spread)
|
|
46
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-far-strength-ambient), transparent);
|
|
47
|
+
--_material-lit: linear-gradient(180deg, var(--newtone-material-edge-top-border), var(--newtone-material-edge-foot-border));
|
|
48
|
+
}
|
|
49
|
+
/* The close shadow for a solid part that stands off what it is on (Canvas.Frame `card`, the slide; Joshua 2026-11-09). */
|
|
50
|
+
.newtone-material-cast-close {
|
|
51
|
+
box-shadow: var(--_material-close);
|
|
52
|
+
}
|
|
53
|
+
/* Solid parts that stand off what they are on, cast here because this is the only sheet that names the close and far
|
|
54
|
+
* shadows (Joshua 2026-11-11: every shadow from one place). Their own sheets keep everything else and point here. */
|
|
55
|
+
.newtone-split-rail-list[data-expand='hover']:is(:hover, :has(:focus-visible)),
|
|
56
|
+
.newtone-slide-list-ghost {
|
|
57
|
+
--_material-contact: 0 var(--newtone-shadow-close-contact-y) var(--newtone-shadow-close-contact-blur) var(--newtone-shadow-close-contact-spread)
|
|
58
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-contact), transparent);
|
|
59
|
+
--_material-close:
|
|
60
|
+
0 var(--newtone-shadow-close-ambient-y) var(--newtone-shadow-close-ambient-blur) var(--newtone-shadow-close-ambient-spread)
|
|
61
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-ambient), transparent),
|
|
62
|
+
var(--_material-contact);
|
|
63
|
+
--_material-far: 0 var(--newtone-shadow-far-ambient-y) var(--newtone-shadow-far-ambient-blur) var(--newtone-shadow-far-ambient-spread)
|
|
64
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-far-strength-ambient), transparent);
|
|
65
|
+
}
|
|
66
|
+
/* The widened rail: its divider's hairline just outside it, then the close shadow (was twice close, hand-drawn). */
|
|
67
|
+
.newtone-split-rail-list[data-expand='hover']:is(:hover, :has(:focus-visible)) {
|
|
68
|
+
box-shadow:
|
|
69
|
+
1px 0 0 0 var(--newtone-role-divider-secondary),
|
|
70
|
+
var(--_material-close);
|
|
71
|
+
}
|
|
72
|
+
/* A slide or section being dragged: the accent ring, then close + far, as a menu stands (was 0 4px 12px 15%). */
|
|
73
|
+
.newtone-slide-list-ghost:is([data-what='slide'], [data-what='section']) {
|
|
74
|
+
box-shadow:
|
|
75
|
+
0 0 0 2px var(--newtone-role-text-accent),
|
|
76
|
+
var(--_material-close),
|
|
77
|
+
var(--_material-far);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ---- Glass ---------------------------------------------------------------------------------------------------- */
|
|
81
|
+
@scope ([data-newtone-material='glass']) to ([data-newtone-material]:not([data-newtone-material='glass'])) {
|
|
82
|
+
/* What an item on the glass wears (a bar's tool, a menu's row, a quiet button): the regular glass's ink and veils
|
|
83
|
+
* unless a menu under it says the thick one's. */
|
|
84
|
+
:scope {
|
|
85
|
+
--_material-item-ink: var(--newtone-material-glass-regular-text);
|
|
86
|
+
--_material-item-hover: var(--newtone-material-glass-regular-item-hover-fill);
|
|
87
|
+
--_material-item-pressed: var(--newtone-material-glass-regular-item-pressed-fill);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* The recipe, once. A Button or Action `primary` wears the raised form without a class: both stay server
|
|
91
|
+
* components, and the boundary reaches them. */
|
|
92
|
+
:where(:scope, *):is(.newtone-glass--bar, .newtone-glass--menu, .newtone-glass--field, .newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action) {
|
|
93
|
+
--_material-paint: var(--_material-wash);
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
background:
|
|
96
|
+
linear-gradient(var(--_material-paint), var(--_material-paint)) padding-box,
|
|
97
|
+
var(--_material-edge) border-box;
|
|
98
|
+
-webkit-backdrop-filter: blur(var(--_material-blur));
|
|
99
|
+
backdrop-filter: blur(var(--_material-blur));
|
|
100
|
+
box-shadow: var(--_material-shadow);
|
|
101
|
+
color: var(--_material-ink);
|
|
102
|
+
}
|
|
103
|
+
:where(:scope, *).newtone-glass--bar {
|
|
104
|
+
--_material-wash: var(--newtone-material-glass-regular-fill);
|
|
105
|
+
--_material-blur: var(--newtone-blur-regular);
|
|
106
|
+
--_material-edge: var(--_material-lit);
|
|
107
|
+
--_material-shadow: var(--_material-close);
|
|
108
|
+
--_material-ink: var(--newtone-material-glass-regular-text);
|
|
109
|
+
}
|
|
110
|
+
/* Rows of words sit on a menu, so its frost is denser than a bar's (Joshua 2026-11-10). */
|
|
111
|
+
:where(:scope, *).newtone-glass--menu {
|
|
112
|
+
--_material-wash: var(--newtone-material-glass-thick-fill);
|
|
113
|
+
--_material-blur: var(--newtone-blur-thick);
|
|
114
|
+
--_material-edge: var(--_material-lit);
|
|
115
|
+
--_material-shadow: var(--_material-close), var(--_material-far);
|
|
116
|
+
--_material-ink: var(--newtone-material-glass-thick-text);
|
|
117
|
+
--_material-item-ink: var(--newtone-material-glass-thick-text);
|
|
118
|
+
--_material-item-hover: var(--newtone-material-glass-thick-item-hover-fill);
|
|
119
|
+
--_material-item-pressed: var(--newtone-material-glass-thick-item-pressed-fill);
|
|
120
|
+
}
|
|
121
|
+
/* The words at rest are quieter than pure ink (75%); solid while focused, so what is typed is plain. */
|
|
122
|
+
:where(:scope, *).newtone-glass--field {
|
|
123
|
+
--_material-wash: var(--newtone-material-glass-regular-fill);
|
|
124
|
+
--_material-blur: var(--newtone-blur-regular);
|
|
125
|
+
--_material-edge: linear-gradient(var(--_material-paint), var(--_material-paint));
|
|
126
|
+
--_material-shadow: none;
|
|
127
|
+
--_material-ink: var(--newtone-material-glass-regular-rest-text);
|
|
128
|
+
}
|
|
129
|
+
:where(:scope, *).newtone-glass--field:focus-within {
|
|
130
|
+
--_material-paint: var(--newtone-role-surface-secondary);
|
|
131
|
+
--_material-blur: 0px;
|
|
132
|
+
--_material-ink: var(--newtone-role-text-primary);
|
|
133
|
+
}
|
|
134
|
+
:where(:scope, *):is(.newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action--primary) {
|
|
135
|
+
--_material-wash: var(--newtone-material-glass-accent-rest-fill);
|
|
136
|
+
--_material-blur: var(--newtone-blur-regular);
|
|
137
|
+
--_material-edge: var(--_material-lit);
|
|
138
|
+
--_material-shadow: var(--_material-close);
|
|
139
|
+
--_material-ink: var(--newtone-button-primary-rest-text);
|
|
140
|
+
}
|
|
141
|
+
:where(:scope, *):is(.newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action--primary):hover {
|
|
142
|
+
--_material-wash: var(--newtone-material-glass-accent-hover-fill);
|
|
143
|
+
--_material-ink: var(--newtone-button-primary-hover-text);
|
|
144
|
+
}
|
|
145
|
+
/* Pressed, it sits down: the contact shadow only. */
|
|
146
|
+
:where(:scope, *):is(.newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action--primary):is(:active, [aria-pressed='true']) {
|
|
147
|
+
--_material-wash: var(--newtone-material-glass-accent-pressed-fill);
|
|
148
|
+
--_material-shadow: var(--_material-contact);
|
|
149
|
+
--_material-ink: var(--newtone-button-primary-pressed-text);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* A neutral QuickAction on the glass: raised as a bar is (its wash, the lit edge, close), the glass's ink, and the
|
|
153
|
+
* glass's veils laid over the wash for hover and press. Pressed, it sits down to the contact shadow. */
|
|
154
|
+
:where(:scope, *).newtone-quick-action:not(.newtone-quick-action--primary) {
|
|
155
|
+
--_material-wash: var(--newtone-material-glass-regular-fill);
|
|
156
|
+
--_material-blur: var(--newtone-blur-regular);
|
|
157
|
+
--_material-edge: var(--_material-lit);
|
|
158
|
+
--_material-shadow: var(--_material-close);
|
|
159
|
+
--_material-ink: var(--newtone-material-glass-regular-text);
|
|
160
|
+
--_material-veil: transparent;
|
|
161
|
+
background:
|
|
162
|
+
linear-gradient(var(--_material-veil), var(--_material-veil)) padding-box,
|
|
163
|
+
linear-gradient(var(--_material-paint), var(--_material-paint)) padding-box,
|
|
164
|
+
var(--_material-edge) border-box;
|
|
165
|
+
}
|
|
166
|
+
:where(:scope, *).newtone-quick-action:not(.newtone-quick-action--primary):hover {
|
|
167
|
+
--_material-veil: var(--newtone-material-glass-regular-item-hover-fill);
|
|
168
|
+
}
|
|
169
|
+
:where(:scope, *).newtone-quick-action:not(.newtone-quick-action--primary):is(:active, [aria-pressed='true']) {
|
|
170
|
+
--_material-veil: var(--newtone-material-glass-regular-item-pressed-fill);
|
|
171
|
+
--_material-shadow: var(--_material-contact);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* A prompt field's hint and its glyphs on the glass: quieter than its words (hint.text, 50%). Focused, it is solid,
|
|
175
|
+
* and they take the secondary text role. */
|
|
176
|
+
:where(:scope, *).newtone-glass--field:not(:focus-within) :is(.newtone-prompt-field-hint, .newtone-prompt-field-slot),
|
|
177
|
+
:where(:scope, *).newtone-glass--field:not(:focus-within) .newtone-prompt-field-input::placeholder {
|
|
178
|
+
color: var(--newtone-material-glass-regular-hint-text);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* A quiet button on the glass (Button `secondary` and `tertiary`, Action `secondary`): the glass's ink and veils. */
|
|
182
|
+
:where(:scope, *):is(.newtone-button--secondary, .newtone-button--tertiary, .newtone-action--secondary):not(:disabled) {
|
|
183
|
+
color: var(--_material-item-ink);
|
|
184
|
+
}
|
|
185
|
+
:where(:scope, *):is(.newtone-button--secondary, .newtone-button--tertiary, .newtone-action--secondary):not(:disabled):hover {
|
|
186
|
+
background: var(--_material-item-hover);
|
|
187
|
+
color: var(--_material-item-ink);
|
|
188
|
+
}
|
|
189
|
+
:where(:scope, *):is(.newtone-button--secondary, .newtone-button--tertiary, .newtone-action--secondary):not(:disabled):active {
|
|
190
|
+
background: var(--_material-item-pressed);
|
|
191
|
+
color: var(--_material-item-ink);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* FloatingBar's tools on the glass: the glass's ink, its veils for hover and press. A tool drawn as a Button
|
|
195
|
+
* (`variant`) keeps the Button's own colours. */
|
|
196
|
+
.newtone-floating-bar-tool:not([data-variant]) {
|
|
197
|
+
color: var(--_material-item-ink);
|
|
198
|
+
}
|
|
199
|
+
.newtone-floating-bar-tool:not([data-variant], :disabled):where(:hover, [data-open]) {
|
|
200
|
+
background: var(--_material-item-hover);
|
|
201
|
+
}
|
|
202
|
+
.newtone-floating-bar-tool:not([data-variant], :disabled):where(:active) {
|
|
203
|
+
background: var(--_material-item-pressed);
|
|
204
|
+
}
|
|
205
|
+
/* The current or chosen tool: a dome (Joshua 2026-11-10), its own fill shaded from dark at the top to light at the
|
|
206
|
+
* foot: the selection's fill with 12% black at the top and 24% white at the foot, as Joshua drew it (2026-11-10;
|
|
207
|
+
* kept over palette steps on the tuning page, 2026-11-11). The component draws the mix, so no token holds it. Ringed in the divider's colour, as the gap between
|
|
208
|
+
* the window's panels, so it reads as set into the bar. Inset, so the tool keeps its size. A `neutral` current one
|
|
209
|
+
* (a view) is the secondary surface's dome. */
|
|
210
|
+
.newtone-floating-bar-tool[aria-pressed='true'] {
|
|
211
|
+
--_dome: var(--newtone-selection-fill);
|
|
212
|
+
background: linear-gradient(180deg, color-mix(in oklab, var(--_dome), black 12%), color-mix(in oklab, var(--_dome), white 24%));
|
|
213
|
+
box-shadow: inset 0 0 0 1px var(--newtone-role-divider-secondary);
|
|
214
|
+
}
|
|
215
|
+
.newtone-floating-bar-tool[aria-pressed='true'][data-neutral] {
|
|
216
|
+
--_dome: var(--newtone-role-surface-secondary);
|
|
217
|
+
}
|
|
218
|
+
/* The chosen tool's glyph (Joshua 2026-11-10): filled, in the accent's words colour, so the tool in use reads at a
|
|
219
|
+
* glance. A `neutral` current one keeps its outline and its ink. Icon writes FILL on the element itself, so the axes
|
|
220
|
+
* are restated with FILL at 1, the others as icon.css sets them. */
|
|
221
|
+
.newtone-floating-bar-tool[aria-pressed='true']:not([data-neutral]) .newtone-icon {
|
|
222
|
+
color: var(--newtone-role-text-accent);
|
|
223
|
+
font-variation-settings:
|
|
224
|
+
'FILL' 1,
|
|
225
|
+
'wght' var(--newtone-icon-weight),
|
|
226
|
+
'GRAD' 0,
|
|
227
|
+
'opsz' clamp(var(--newtone-icon-opsz-min), var(--newtone-icon-px), var(--newtone-icon-opsz-max));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* A menu's rows on the glass: the menu's veil under the one pointed at, kept or opened. `danger` keeps its colour. */
|
|
231
|
+
.newtone-pop-menu-row:not(:disabled):where(:hover, :focus-visible) {
|
|
232
|
+
background: var(--_material-item-hover);
|
|
233
|
+
}
|
|
234
|
+
.newtone-pop-menu-row:not(:disabled):where(:active) {
|
|
235
|
+
background: var(--_material-item-pressed);
|
|
236
|
+
}
|
|
237
|
+
.newtone-app-frame-menu-item:is(:hover, :focus-visible),
|
|
238
|
+
.newtone-app-frame-menu-item.newtone-app-frame-main-menu-row[data-open] {
|
|
239
|
+
background: var(--_material-item-hover);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Where the glass cannot be seen through (no backdrop-filter) or should not be (reduced transparency), each recipe
|
|
244
|
+
* is its own wash at full strength and nothing is blurred: the same colour, opaque. With more contrast asked for, also
|
|
245
|
+
* the quieter ink goes to pure ink. */
|
|
246
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
247
|
+
@scope ([data-newtone-material='glass']) to ([data-newtone-material]:not([data-newtone-material='glass'])) {
|
|
248
|
+
:where(:scope, *):is(.newtone-glass--bar, .newtone-glass--menu, .newtone-glass--field, .newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action) {
|
|
249
|
+
--_material-paint: oklch(from var(--_material-wash) l c h / 1);
|
|
250
|
+
--_material-blur: 0px;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
|
|
255
|
+
@scope ([data-newtone-material='glass']) to ([data-newtone-material]:not([data-newtone-material='glass'])) {
|
|
256
|
+
:where(:scope, *):is(.newtone-glass--bar, .newtone-glass--menu, .newtone-glass--field, .newtone-glass--action, .newtone-button--primary:not(:disabled), .newtone-action:not(.newtone-action--secondary), .newtone-quick-action) {
|
|
257
|
+
--_material-paint: oklch(from var(--_material-wash) l c h / 1);
|
|
258
|
+
--_material-blur: 0px;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
@media (prefers-contrast: more) {
|
|
263
|
+
@scope ([data-newtone-material='glass']) to ([data-newtone-material]:not([data-newtone-material='glass'])) {
|
|
264
|
+
:where(:scope, *).newtone-glass--field {
|
|
265
|
+
--_material-ink: var(--newtone-material-glass-regular-text);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* ---- Crystal -------------------------------------------------------------------------------------------------- */
|
|
271
|
+
/* An inset screen with bezels (Joshua 2026-11-11), what content sits on: Show's slide area. Its ground is the deep
|
|
272
|
+
* rung's primary surface, what C2 stood on before (a role, so no token of its own; not the secondary: glass mixes
|
|
273
|
+
* the secondary, so a PromptField on it vanished, Joshua 2026-11-11); its bezel the lit edge reversed, dark at the
|
|
274
|
+
* top and light at the foot, so it reads as set in; and the close shadow cast inward, over what is on it.
|
|
275
|
+
* 1px the bezel
|
|
276
|
+
* radius.md its corners */
|
|
277
|
+
[data-newtone-material='crystal'] {
|
|
278
|
+
position: relative;
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
border: 1px solid transparent;
|
|
281
|
+
border-radius: var(--newtone-radius-md);
|
|
282
|
+
background:
|
|
283
|
+
linear-gradient(var(--newtone-role-surface-primary), var(--newtone-role-surface-primary)) padding-box,
|
|
284
|
+
linear-gradient(180deg, var(--newtone-material-crystal-bezel-top-border), var(--newtone-material-crystal-bezel-foot-border)) border-box;
|
|
285
|
+
}
|
|
286
|
+
/* The inset shadow over what is on the screen (a canvas paints its own ground over the screen's background), under the
|
|
287
|
+
* bars that float on it, and never in the way of a press. */
|
|
288
|
+
[data-newtone-material='crystal']::after {
|
|
289
|
+
content: '';
|
|
290
|
+
position: absolute;
|
|
291
|
+
inset: 0;
|
|
292
|
+
z-index: 4;
|
|
293
|
+
border-radius: calc(var(--newtone-radius-md) - 1px);
|
|
294
|
+
box-shadow:
|
|
295
|
+
inset 0 var(--newtone-shadow-close-ambient-y) var(--newtone-shadow-close-ambient-blur) var(--newtone-shadow-close-ambient-spread)
|
|
296
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-ambient), transparent),
|
|
297
|
+
inset 0 var(--newtone-shadow-close-contact-y) var(--newtone-shadow-close-contact-blur) var(--newtone-shadow-close-contact-spread)
|
|
298
|
+
color-mix(in oklab, var(--newtone-material-cast-fill) var(--newtone-shadow-close-strength-contact), transparent);
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
}
|
|
301
|
+
@scope ([data-newtone-material='crystal']) to ([data-newtone-material]:not([data-newtone-material='crystal'])) {
|
|
302
|
+
/* A canvas with no ground of its own shows the screen's, and dims outside its frame with it. */
|
|
303
|
+
.newtone-canvas:where([data-ground='none']) {
|
|
304
|
+
--_canvas-ground: var(--newtone-role-surface-primary);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What a part is made of (Joshua 2026-11-11). Three materials:
|
|
4
|
+
* glass the translucent control layer: bars, menus, the prompt field, the raised primary button
|
|
5
|
+
* crystal an inset screen with bezels that content sits on (Show's slide area, Workbench C2)
|
|
6
|
+
* solid plain, the default: no boundary above means solid
|
|
7
|
+
*/
|
|
8
|
+
export type MaterialKind = 'glass' | 'crystal' | 'solid';
|
|
9
|
+
export type MaterialProps = ({
|
|
10
|
+
glass: true;
|
|
11
|
+
crystal?: never;
|
|
12
|
+
solid?: never;
|
|
13
|
+
} | {
|
|
14
|
+
crystal: true;
|
|
15
|
+
glass?: never;
|
|
16
|
+
solid?: never;
|
|
17
|
+
} | {
|
|
18
|
+
solid: true;
|
|
19
|
+
glass?: never;
|
|
20
|
+
crystal?: never;
|
|
21
|
+
}) & {
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
};
|
|
25
|
+
/** The nearest material boundary's kind: for client parts, for native and for anything moved out of the DOM tree. */
|
|
26
|
+
export declare const MaterialContext: import("react").Context<MaterialKind | null>;
|
|
27
|
+
/**
|
|
28
|
+
* The material its contents wear. Like Surface it is an attribute (`data-newtone-material`) the stylesheet reads, and
|
|
29
|
+
* unlike Surface it is also a React context, so a part rendered elsewhere still knows. The wrapper takes no room
|
|
30
|
+
* (`display: contents`), so it is safe in a flex row. The nearest boundary wins; a `solid` one ends the glass above
|
|
31
|
+
* it. Blueprint components/material.md.
|
|
32
|
+
*/
|
|
33
|
+
export declare function Material(props: MaterialProps): import("react").JSX.Element;
|
|
34
|
+
/** The material of the nearest boundary above, or null when there is none (solid). */
|
|
35
|
+
export declare function useMaterial(): MaterialKind | null;
|
|
36
|
+
/**
|
|
37
|
+
* For a part that is a boundary by what it is (Canvas.Dock, a Workbench foot): the attribute it stamps on its own root.
|
|
38
|
+
* Internal: not exported from the index.
|
|
39
|
+
*/
|
|
40
|
+
export declare function materialRoot(kind: MaterialKind | null): {
|
|
41
|
+
'data-newtone-material'?: MaterialKind;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=material.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/material/material.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,CACtB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/C;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/C;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CACpD,GAAG;IACA,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,qHAAqH;AACrH,eAAO,MAAM,eAAe,8CAA2C,CAAA;AAEvE;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAS5C;AAED,sFAAsF;AACtF,wBAAgB,WAAW,IAAI,YAAY,GAAG,IAAI,CAEjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG;IAAE,uBAAuB,CAAC,EAAE,YAAY,CAAA;CAAE,CAElG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
/** The nearest material boundary's kind: for client parts, for native and for anything moved out of the DOM tree. */
|
|
5
|
+
export const MaterialContext = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* The material its contents wear. Like Surface it is an attribute (`data-newtone-material`) the stylesheet reads, and
|
|
8
|
+
* unlike Surface it is also a React context, so a part rendered elsewhere still knows. The wrapper takes no room
|
|
9
|
+
* (`display: contents`), so it is safe in a flex row. The nearest boundary wins; a `solid` one ends the glass above
|
|
10
|
+
* it. Blueprint components/material.md.
|
|
11
|
+
*/
|
|
12
|
+
export function Material(props) {
|
|
13
|
+
const kind = props.glass ? 'glass' : props.crystal ? 'crystal' : 'solid';
|
|
14
|
+
return (_jsx(MaterialContext.Provider, { value: kind, children: _jsx("div", { className: ['newtone-material', props.className].filter(Boolean).join(' '), "data-newtone-material": kind, children: props.children }) }));
|
|
15
|
+
}
|
|
16
|
+
/** The material of the nearest boundary above, or null when there is none (solid). */
|
|
17
|
+
export function useMaterial() {
|
|
18
|
+
return useContext(MaterialContext);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* For a part that is a boundary by what it is (Canvas.Dock, a Workbench foot): the attribute it stamps on its own root.
|
|
22
|
+
* Internal: not exported from the index.
|
|
23
|
+
*/
|
|
24
|
+
export function materialRoot(kind) {
|
|
25
|
+
return kind ? { 'data-newtone-material': kind } : {};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=material.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../src/material/material.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAA;AAmBjE,qHAAqH;AACrH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAA;AAEvE;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IACzC,MAAM,IAAI,GAAiB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;IACtF,OAAO,CACH,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YACjC,cAAK,SAAS,EAAE,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,2BAAyB,IAAI,YACvG,KAAK,CAAC,QAAQ,GACb,GACiB,CAC9B,CAAA;AACL,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,WAAW;IACvB,OAAO,UAAU,CAAC,eAAe,CAAC,CAAA;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAyB;IAClD,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
* 20px glyph inside a 24px leading -- the exact defect Control shipped with on 2026-09-16. The 48 is
|
|
95
95
|
* `size="xl"`, a rung, and the rung carries the glyph with it. components/control.md.
|
|
96
96
|
*
|
|
97
|
-
* THE BLUR
|
|
98
|
-
* trade travels with it: a photograph carries high-frequency detail and a translucent plate inherits
|
|
97
|
+
* THE BLUR is `blur.regular` (16px), a token since 2026-11-11 (Joshua). It is load-bearing
|
|
98
|
+
* rather than decorative and the trade travels with it: a photograph carries high-frequency detail and a translucent plate inherits
|
|
99
99
|
* it straight through, so blurring the backdrop removes the frequency and keeps the colour, and that
|
|
100
100
|
* is what lets the fill sit at 45% instead of the ~100% an unblurred plate would need. **Where
|
|
101
101
|
* `backdrop-filter` is unsupported this degrades to a black glyph on a flat 45% wash**, which is
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
/* The ring's gradient, by state, from 0.15.0: rest here, hover and pressed below. */
|
|
144
144
|
--_on-media-rim: var(--newtone-on-media-control-rest-border);
|
|
145
145
|
|
|
146
|
-
-webkit-backdrop-filter: blur(
|
|
147
|
-
backdrop-filter: blur(
|
|
146
|
+
-webkit-backdrop-filter: blur(var(--newtone-blur-regular));
|
|
147
|
+
backdrop-filter: blur(var(--newtone-blur-regular));
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.newtone-on-media-control:hover {
|
|
@@ -216,8 +216,8 @@
|
|
|
216
216
|
color: var(--newtone-on-media-control-rest-text);
|
|
217
217
|
border: 1px solid transparent;
|
|
218
218
|
border-radius: 50%;
|
|
219
|
-
-webkit-backdrop-filter: blur(
|
|
220
|
-
backdrop-filter: blur(
|
|
219
|
+
-webkit-backdrop-filter: blur(var(--newtone-blur-regular));
|
|
220
|
+
backdrop-filter: blur(var(--newtone-blur-regular));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
/* The filled action, and it is three declarations because it is PAINT and not a box.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type BlockKind = 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'bullet' | 'numbered' | 'todo' | 'quote' | 'code' | 'divider' | 'image' | 'raw';
|
|
2
|
+
export interface Block {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: BlockKind;
|
|
5
|
+
/** What is typed in it; for an image its alt words, for code its lines, for raw its markdown. */
|
|
6
|
+
text: string;
|
|
7
|
+
/** A to-do's box. */
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/** A code block's language; an image's address. */
|
|
10
|
+
meta?: string;
|
|
11
|
+
}
|
|
12
|
+
/** The kinds a writer picks from `/`, in the menu's order. */
|
|
13
|
+
export declare const PICKABLE: readonly ["paragraph", "heading1", "heading2", "heading3", "bullet", "numbered", "todo", "quote", "code", "divider"];
|
|
14
|
+
export declare const newId: () => string;
|
|
15
|
+
export declare const block: (kind: BlockKind, text?: string, extra?: Partial<Block>) => Block;
|
|
16
|
+
export declare const continues: (kind: BlockKind) => boolean;
|
|
17
|
+
/** Markdown read as blocks. Never empty: a page with nothing in it is one empty paragraph. */
|
|
18
|
+
export declare function parse(markdown: string): Block[];
|
|
19
|
+
/** Blocks written as markdown: a list's items one line apart, everything else a blank line apart. */
|
|
20
|
+
export declare function serialize(blocks: readonly Block[]): string;
|
|
21
|
+
/** What a numbered item reads as: its place in the run of numbered items it is in. */
|
|
22
|
+
export declare function numberOf(blocks: readonly Block[], index: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* What typing a space after these at the start of a paragraph turns it into, as in Notion: `#` a heading, `-` a
|
|
25
|
+
* bullet, `1.` a numbered item, `[]` a to-do, `>` a quote.
|
|
26
|
+
*/
|
|
27
|
+
export declare function shortcut(before: string): Partial<Block> | null;
|
|
28
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/page-editor/blocks.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,SAAS,GACf,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,OAAO,GACP,KAAK,CAAA;AAEX,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,CAAA;IACf,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,8DAA8D;AAC9D,eAAO,MAAM,QAAQ,sHAWoB,CAAA;AAGzC,eAAO,MAAM,KAAK,cAAqB,CAAA;AACvC,eAAO,MAAM,KAAK,SAAU,SAAS,yBAAoB,OAAO,CAAC,KAAK,CAAC,KAAQ,KAK7E,CAAA;AAIF,eAAO,MAAM,SAAS,SAAU,SAAS,KAAG,OAAsE,CAAA;AAsBlH,8FAA8F;AAC9F,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAE,CAyE/C;AAsCD,qGAAqG;AACrG,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CAa1D;AAED,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAU9D"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// A page as blocks, and back to markdown: what PageEditor edits (components/page-editor.md). Each block is one thing
|
|
2
|
+
// the writer types into: a paragraph, a heading, a list item, a to-do, a quote, a code block, a rule or an image.
|
|
3
|
+
// Markdown read here and written back comes out as written for every kind a block has; anything else (a table, a
|
|
4
|
+
// deeper heading, raw HTML) is kept whole as a `raw` block, word for word, so nothing a writer made is lost.
|
|
5
|
+
/** The kinds a writer picks from `/`, in the menu's order. */
|
|
6
|
+
export const PICKABLE = [
|
|
7
|
+
'paragraph',
|
|
8
|
+
'heading1',
|
|
9
|
+
'heading2',
|
|
10
|
+
'heading3',
|
|
11
|
+
'bullet',
|
|
12
|
+
'numbered',
|
|
13
|
+
'todo',
|
|
14
|
+
'quote',
|
|
15
|
+
'code',
|
|
16
|
+
'divider',
|
|
17
|
+
];
|
|
18
|
+
let next = 0;
|
|
19
|
+
export const newId = () => `b${++next}`;
|
|
20
|
+
export const block = (kind, text = '', extra = {}) => ({
|
|
21
|
+
id: newId(),
|
|
22
|
+
kind,
|
|
23
|
+
text,
|
|
24
|
+
...extra,
|
|
25
|
+
});
|
|
26
|
+
/** Kinds a list is made of: written one line apart, and Enter at the end of one starts another. */
|
|
27
|
+
const LISTS = { bullet: 'bullet', todo: 'bullet', numbered: 'numbered' };
|
|
28
|
+
export const continues = (kind) => kind === 'bullet' || kind === 'numbered' || kind === 'todo';
|
|
29
|
+
const FENCE = /^(\s*)(`{3,}|~{3,})\s*([\w+#.-]*)\s*$/;
|
|
30
|
+
const HEADING = /^(#{1,3})\s+(.*)$/;
|
|
31
|
+
const TODO = /^[-*+]\s+\[( |x|X)\]\s+(.*)$/;
|
|
32
|
+
const BULLET = /^[-*+]\s+(.*)$/;
|
|
33
|
+
const NUMBERED = /^\d{1,9}[.)]\s+(.*)$/;
|
|
34
|
+
const QUOTE = /^>\s?(.*)$/;
|
|
35
|
+
const RULE = /^\s*(?:-{3,}|\*{3,}|_{3,})\s*$/;
|
|
36
|
+
const IMAGE = /^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/;
|
|
37
|
+
// What a paragraph is not: a line that would start another kind, or a table's.
|
|
38
|
+
const STARTS = (line) => FENCE.test(line) ||
|
|
39
|
+
/^#{1,6}\s/.test(line) ||
|
|
40
|
+
BULLET.test(line) ||
|
|
41
|
+
NUMBERED.test(line) ||
|
|
42
|
+
QUOTE.test(line) ||
|
|
43
|
+
RULE.test(line) ||
|
|
44
|
+
IMAGE.test(line) ||
|
|
45
|
+
/^\s*\|/.test(line) ||
|
|
46
|
+
/^\s*</.test(line);
|
|
47
|
+
/** Markdown read as blocks. Never empty: a page with nothing in it is one empty paragraph. */
|
|
48
|
+
export function parse(markdown) {
|
|
49
|
+
const lines = markdown.replace(/\r\n?/g, '\n').split('\n');
|
|
50
|
+
const out = [];
|
|
51
|
+
let i = 0;
|
|
52
|
+
while (i < lines.length) {
|
|
53
|
+
const line = lines[i];
|
|
54
|
+
if (!line.trim()) {
|
|
55
|
+
i++;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const fence = line.match(FENCE);
|
|
59
|
+
if (fence) {
|
|
60
|
+
const body = [];
|
|
61
|
+
i++;
|
|
62
|
+
while (i < lines.length && !lines[i].trim().startsWith(fence[2]))
|
|
63
|
+
body.push(lines[i++]);
|
|
64
|
+
i++;
|
|
65
|
+
out.push(block('code', body.join('\n'), { meta: fence[3] || undefined }));
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
let m;
|
|
69
|
+
if ((m = line.match(HEADING))) {
|
|
70
|
+
out.push(block(`heading${m[1].length}`, m[2].trim()));
|
|
71
|
+
i++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (RULE.test(line)) {
|
|
75
|
+
out.push(block('divider'));
|
|
76
|
+
i++;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if ((m = line.match(IMAGE))) {
|
|
80
|
+
out.push(block('image', m[1], { meta: m[2] }));
|
|
81
|
+
i++;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const item = (m = line.match(TODO))
|
|
85
|
+
? block('todo', m[2], { checked: m[1] !== ' ' })
|
|
86
|
+
: (m = line.match(BULLET))
|
|
87
|
+
? block('bullet', m[1])
|
|
88
|
+
: (m = line.match(NUMBERED))
|
|
89
|
+
? block('numbered', m[1])
|
|
90
|
+
: null;
|
|
91
|
+
if (item) {
|
|
92
|
+
i++;
|
|
93
|
+
// A line indented under an item goes on with it.
|
|
94
|
+
while (i < lines.length && /^\s{2,}\S/.test(lines[i]) && !/^\s*([-*+]|\d+[.)])\s/.test(lines[i]))
|
|
95
|
+
item.text += `\n${lines[i++].trim()}`;
|
|
96
|
+
out.push(item);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (QUOTE.test(line)) {
|
|
100
|
+
const body = [];
|
|
101
|
+
while (i < lines.length && (m = lines[i].match(QUOTE))) {
|
|
102
|
+
body.push(m[1]);
|
|
103
|
+
i++;
|
|
104
|
+
}
|
|
105
|
+
out.push(block('quote', body.join('\n')));
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (/^#{4,6}\s/.test(line) || /^\s*\|/.test(line) || /^\s*</.test(line)) {
|
|
109
|
+
// Kept as written, up to the next blank line.
|
|
110
|
+
const body = [];
|
|
111
|
+
while (i < lines.length && lines[i].trim())
|
|
112
|
+
body.push(lines[i++]);
|
|
113
|
+
out.push(block('raw', body.join('\n')));
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const body = [line];
|
|
117
|
+
i++;
|
|
118
|
+
while (i < lines.length && lines[i].trim() && !STARTS(lines[i]))
|
|
119
|
+
body.push(lines[i++]);
|
|
120
|
+
out.push(block('paragraph', body.join('\n')));
|
|
121
|
+
}
|
|
122
|
+
return out.length ? out : [block('paragraph')];
|
|
123
|
+
}
|
|
124
|
+
/** One block as markdown. `n`: a numbered item's number. */
|
|
125
|
+
function write(b, n) {
|
|
126
|
+
const indent = (prefix) => `${prefix}${b.text.split('\n').join(`\n${' '.repeat(prefix.length)}`)}`;
|
|
127
|
+
switch (b.kind) {
|
|
128
|
+
case 'heading1':
|
|
129
|
+
return `# ${b.text}`;
|
|
130
|
+
case 'heading2':
|
|
131
|
+
return `## ${b.text}`;
|
|
132
|
+
case 'heading3':
|
|
133
|
+
return `### ${b.text}`;
|
|
134
|
+
case 'bullet':
|
|
135
|
+
return indent('- ');
|
|
136
|
+
case 'numbered':
|
|
137
|
+
return indent(`${n}. `);
|
|
138
|
+
case 'todo':
|
|
139
|
+
return indent(`- [${b.checked ? 'x' : ' '}] `);
|
|
140
|
+
case 'quote':
|
|
141
|
+
return b.text
|
|
142
|
+
.split('\n')
|
|
143
|
+
.map((l) => (l ? `> ${l}` : '>'))
|
|
144
|
+
.join('\n');
|
|
145
|
+
case 'code': {
|
|
146
|
+
// A fence longer than any run of backticks inside.
|
|
147
|
+
const longest = Math.max(2, ...(b.text.match(/`+/g) ?? []).map((r) => r.length));
|
|
148
|
+
const fence = '`'.repeat(longest + 1);
|
|
149
|
+
return `${fence}${b.meta ?? ''}\n${b.text}\n${fence}`;
|
|
150
|
+
}
|
|
151
|
+
case 'divider':
|
|
152
|
+
return '---';
|
|
153
|
+
case 'image':
|
|
154
|
+
return ``;
|
|
155
|
+
default:
|
|
156
|
+
return b.text;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** Blocks written as markdown: a list's items one line apart, everything else a blank line apart. */
|
|
160
|
+
export function serialize(blocks) {
|
|
161
|
+
let out = '';
|
|
162
|
+
let n = 0;
|
|
163
|
+
blocks.forEach((b, i) => {
|
|
164
|
+
const prev = blocks[i - 1];
|
|
165
|
+
n = b.kind === 'numbered' ? (prev?.kind === 'numbered' ? n + 1 : 1) : 0;
|
|
166
|
+
// An empty paragraph between others is only room to type: it writes nothing.
|
|
167
|
+
if (b.kind === 'paragraph' && !b.text.trim())
|
|
168
|
+
return;
|
|
169
|
+
const text = write(b, n);
|
|
170
|
+
if (out)
|
|
171
|
+
out += prev && LISTS[prev.kind] && LISTS[prev.kind] === LISTS[b.kind] ? '\n' : '\n\n';
|
|
172
|
+
out += text;
|
|
173
|
+
});
|
|
174
|
+
return out ? `${out}\n` : '';
|
|
175
|
+
}
|
|
176
|
+
/** What a numbered item reads as: its place in the run of numbered items it is in. */
|
|
177
|
+
export function numberOf(blocks, index) {
|
|
178
|
+
let n = 1;
|
|
179
|
+
for (let i = index - 1; i >= 0 && blocks[i].kind === 'numbered'; i--)
|
|
180
|
+
n++;
|
|
181
|
+
return n;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* What typing a space after these at the start of a paragraph turns it into, as in Notion: `#` a heading, `-` a
|
|
185
|
+
* bullet, `1.` a numbered item, `[]` a to-do, `>` a quote.
|
|
186
|
+
*/
|
|
187
|
+
export function shortcut(before) {
|
|
188
|
+
if (before === '#')
|
|
189
|
+
return { kind: 'heading1' };
|
|
190
|
+
if (before === '##')
|
|
191
|
+
return { kind: 'heading2' };
|
|
192
|
+
if (before === '###')
|
|
193
|
+
return { kind: 'heading3' };
|
|
194
|
+
if (before === '-' || before === '*' || before === '+')
|
|
195
|
+
return { kind: 'bullet' };
|
|
196
|
+
if (/^\d{1,9}[.)]$/.test(before))
|
|
197
|
+
return { kind: 'numbered' };
|
|
198
|
+
if (before === '[]' || before === '[ ]')
|
|
199
|
+
return { kind: 'todo', checked: false };
|
|
200
|
+
if (before === '[x]')
|
|
201
|
+
return { kind: 'todo', checked: true };
|
|
202
|
+
if (before === '>')
|
|
203
|
+
return { kind: 'quote' };
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=blocks.js.map
|