@threadlabs/looma 0.43.1 → 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/components/ui-callout/ui-callout.html +4 -4
- package/components/ui-dialog/ui-dialog.html +0 -4
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.html +4 -50
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js +10 -31
- package/components/ui-site-header/ui-site-header.html +1 -1
- package/dist/index.js +1 -1
- package/docs/README.md +19 -3
- package/docs/card.html +1 -1
- package/docs/catalog-view.js +11 -5
- package/docs/catalog-view.mjs +4 -3
- package/docs/catalog.json +76 -112
- package/docs/catalog.mjs +1 -1
- package/docs/customizer-render.mjs +9 -8
- package/docs/customizer.js +8 -8
- package/docs/documentation.css +2 -2
- package/docs/examples/ui-editor-footnote-editor/examples/01-note.behavior.js +9 -0
- package/docs/fonts.mjs +1 -1
- package/docs/index.mjs +1 -1
- package/docs/render.mjs +1 -1
- package/docs/site.mjs +14 -5
- package/docs/theme.mjs +96 -16
- package/editor/chunks/extensions.js +10 -0
- package/editor/extensions/footnote.d.ts +1 -0
- package/editor/footnote-editing.d.ts +16 -27
- package/package.json +2 -2
- package/styles/ui-callout.css +4 -4
- package/styles/ui-dialog.css +0 -8
- package/styles/ui-site-header.css +1 -1
- package/theme-dark.css +9 -9
- package/theme-high-contrast.css +4 -0
- package/theme-light.css +6 -6
- package/tokens.css +20 -18
- package/vanilla/UiEditorFootnoteEditor.d.ts +0 -5
- package/vanilla/UiEditorFootnoteEditor.js +20 -68
- package/vue/UiCallout.vue +4 -4
- package/vue/UiDialog.vue +0 -7
- package/vue/UiEditorFootnoteEditor.d.ts +11 -29
- package/vue/UiEditorFootnoteEditor.vue +21 -173
- package/vue/UiSiteHeader.vue +1 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiEditorFootnoteEditor.js +34 -226
- package/vue/chunks/UiEditorImageToolbar.js +1 -1
- package/vue/chunks/UiEditorLinkForm.js +1 -1
- package/vue/chunks/UiSiteHeader.js +1 -1
- package/vue/chunks/compact.js +565 -0
- package/vue/components.css +321 -328
- package/vue/editor/LoomaEditor.d.ts +2 -2
- package/vue/editor/compact/index.js +1 -562
- package/vue/editor/index.js +173 -80
- package/vue/index.js +2 -2
package/docs/README.md
CHANGED
|
@@ -12,12 +12,12 @@ In a project with a `package.json`, install Looma and its documentation tools:
|
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
pnpm add @threadlabs/looma @nextwebwg/html-next@1.0.0-alpha.69
|
|
15
|
-
pnpm add -D 'markupress@>=0.10.
|
|
15
|
+
pnpm add -D 'markupress@>=0.10.3 <1' '@threadlabs/markupkit@>=0.2.0 <1' vite
|
|
16
16
|
pnpm exec looma-docs init --title "The Fellowship"
|
|
17
17
|
pnpm exec looma-docs dev
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Use the tool versions accepted by Looma's optional peer dependencies. Markupress 0.10.
|
|
20
|
+
Use the tool versions accepted by Looma's optional peer dependencies. Markupress 0.10.3 and later compatible 0.x releases supply section navigation with category overview links, a full-height sidebar, the shared Looma site header, mobile home-page navigation, and one appearance button that cycles Automatic, Light and Dark. Regular component imports do not load the documentation server. Vue and Tiptap remain optional; install them when your own authored documentation mounts the Vue editor.
|
|
21
21
|
|
|
22
22
|
Initialization creates three project-owned files:
|
|
23
23
|
|
|
@@ -31,6 +31,8 @@ Import `./looma.theme.css` after Looma's tokens and palette in your application'
|
|
|
31
31
|
|
|
32
32
|
The CSS includes generated derivation rules as well as values. Re-export or save your recipe after a Looma upgrade to adopt updated rules.
|
|
33
33
|
|
|
34
|
+
Component navigation keeps every category linked and lists reference pages only beneath the current category. Category links open galleries with the matching filter selected; individual links open their references. Section selection survives reload and browser history, and overview cards render before JavaScript. The Section dropdown navigates between galleries; Filter components narrows only the cards on the current page, and changing sections starts with a fresh filter. Markupress supplies the section navigation and its continuous sidebar background. Editor references have their own section, with concise display names independent of component tags.
|
|
35
|
+
|
|
34
36
|
Open the local address printed by `dev`, choose **Customize**, and save your theme. Saving updates those shared theme files and rebuilds the documentation. Your application consumes the same CSS import. A static or public site instead offers CSS and recipe downloads.
|
|
35
37
|
|
|
36
38
|
Starting points set a complete identity across color, typography, shape, spacing,
|
|
@@ -92,7 +94,16 @@ Documentation navigation stays out of the customization workspace. **Material &
|
|
|
92
94
|
|
|
93
95
|
Material starts with Finish, Transparency and Frosting. Advanced material contains the light source and its color, edge light, glow, depth and decorative rim extent. The quiet grid stays fixed across the customizer while the page scrolls; content plates remain opaque.
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
The starting themes make different choices within the same controls:
|
|
98
|
+
|
|
99
|
+
- **Clear:** gray neutrals, restrained status tints and minimal depth.
|
|
100
|
+
- **Gold:** warm primary actions, plum links and selection, rounded polished surfaces, and Lato/Fraunces.
|
|
101
|
+
- **Bookish:** wine guidance and confirmations, coral and leather accents, restrained risk colors, and Open Sans/Newsreader.
|
|
102
|
+
- **Editorial:** flat ink-and-paper surfaces, rust links, serif type, and primary-color statuses distinguished by icons and labels.
|
|
103
|
+
- **Night:** cool supporting accents, amber warnings, glass material, and IBM Plex Sans/Mono.
|
|
104
|
+
- **Garden:** forest, clay and gold, soft rounded surfaces, and Nunito Sans/Lora.
|
|
105
|
+
|
|
106
|
+
A refined preset keeps its name with “customized” beside it. **Reset material** resets only material and light; **Reset palette** resets only the palette. Status color relationships offer **Semantic colors**, **Less color**, and **Primary + icons**. **Reset status colors** restores the selected status relationship without changing brand colors, type, or material; advanced per-status relationships remain available. These family choices are recorded in the recipe's optional `presets` mapping. The `values` mapping remains the complete source of the generated theme; a preset is a named combination of those values.
|
|
96
107
|
|
|
97
108
|
Number controls accept arithmetic such as `1rem / 1.2` or `150ms * 2`, calculate on entry and show the result. Unit changes preserve the quantity. Sliders include exact entry, and curve handles support dragging and arrow keys alongside numeric coordinates. LightEditor keeps its coordinate fields under **Exact position**. Light and curve drags preserve the grab offset; Escape or pointer cancellation restores the gesture start without creating a saved edit.
|
|
98
109
|
|
|
@@ -229,13 +240,18 @@ Place a `docs.json` beside it to join a shared category:
|
|
|
229
240
|
```json
|
|
230
241
|
{
|
|
231
242
|
"title": "Office status",
|
|
243
|
+
"summary": "The office’s current status.",
|
|
232
244
|
"description": "A status for the Fellowship office.",
|
|
233
245
|
"group": "display"
|
|
234
246
|
}
|
|
235
247
|
```
|
|
236
248
|
|
|
249
|
+
An optional `summary` supplies the short card text; `description` supplies the full reference introduction. Cards use `description` when no summary is authored.
|
|
250
|
+
|
|
237
251
|
Looma's category IDs are listed in its published catalog. Components without a category appear in **Project components**. A discovery root can declare additional `groups` as `{ "id": "…", "label": "…" }` entries. The top-level `categories` mapping explicitly maps category IDs when combining catalogs.
|
|
238
252
|
|
|
253
|
+
A component card should demonstrate its defining feature, including a non-default configuration when that makes the behavior clear. A feature demonstration does not require changing the component’s default.
|
|
254
|
+
|
|
239
255
|
Put authored examples in an `examples/` directory beside the resource. Each `.html` example starts with a metadata comment:
|
|
240
256
|
|
|
241
257
|
```html
|
package/docs/card.html
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
.example-heading p { margin: var(--ui-space-2) 0 0 !important; color: var(--ui-text-secondary); font-size: var(--ui-font-size-sm); }
|
|
58
58
|
:host([reference]) .preview { min-block-size: 11rem; display: grid !important; align-items: center !important; border-block-end: 0; }
|
|
59
59
|
:host([reference]) .preview::before { display: none; }
|
|
60
|
-
.preview { position: relative; min-block-size: 13rem; overflow: hidden; border-block-end: var(--ui-border-width) solid var(--ui-border); background:
|
|
60
|
+
.preview { position: relative; min-block-size: 13rem; overflow: hidden; border-block-end: var(--ui-border-width) solid var(--ui-border); background: var(--ui-surface-raised); }
|
|
61
61
|
.preview::before { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: 3.5rem; block-size: 3px; background: var(--_card-accent); content: ""; z-index: 1; }
|
|
62
62
|
.stage { inline-size: var(--_preview-width, 100%); max-inline-size: 100%; min-inline-size: 0; }
|
|
63
63
|
footer { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: var(--ui-space-2) !important; }
|
package/docs/catalog-view.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
/** Native catalog entries own their visibility; component previews keep their own layout. */
|
|
2
2
|
export function connect(host) {
|
|
3
|
-
const { query, category, count } = host.refs;
|
|
3
|
+
const { query, category, count, filters } = host.refs;
|
|
4
4
|
const groups = [...host.element.querySelectorAll('[data-catalog-group]')];
|
|
5
5
|
const items = [...host.element.querySelectorAll('[data-catalog-search]')];
|
|
6
|
+
query.value = '';
|
|
6
7
|
const filter = () => {
|
|
7
8
|
const words = query.value.toLocaleLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
8
9
|
let visible = 0;
|
|
9
10
|
for (const item of items) {
|
|
10
|
-
item.hidden =
|
|
11
|
+
item.hidden = !words.every(word => item.dataset.catalogSearch.toLocaleLowerCase().includes(word));
|
|
11
12
|
if (!item.hidden) visible++;
|
|
12
13
|
}
|
|
13
14
|
for (const group of groups) group.hidden = ![...group.querySelectorAll('[data-catalog-search]')].some(item => !item.hidden);
|
|
14
|
-
count.textContent = visible === 0 ? 'No components match. Try another name or
|
|
15
|
+
count.textContent = visible === 0 ? 'No components match. Try another name or section.' : `${visible} component${visible === 1 ? '' : 's'}`;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const chooseCategory = () => {
|
|
18
|
+
const destination = new URL(category.selectedOptions[0].dataset.href, location.href);
|
|
19
|
+
location.assign(destination.href);
|
|
20
|
+
};
|
|
21
|
+
query.addEventListener('input', filter); category.addEventListener('change', chooseCategory); filter();
|
|
22
|
+
filters.hidden = false;
|
|
23
|
+
return () => { query.removeEventListener('input', filter); category.removeEventListener('change', chooseCategory); };
|
|
18
24
|
}
|
package/docs/catalog-view.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { escapeHtml as escape } from './catalog.mjs';
|
|
2
2
|
|
|
3
3
|
/** Catalog filtering wraps the same server-rendered documentation cards. */
|
|
4
|
-
export function catalogResource(groups) {
|
|
4
|
+
export function catalogResource(groups, base = '/') {
|
|
5
5
|
return `<link rel="component" href="@threadlabs/looma/components/ui-form-field/ui-form-field.html">
|
|
6
6
|
<link rel="component" href="@threadlabs/looma/components/ui-input/ui-input.html">
|
|
7
7
|
<link rel="component" href="@threadlabs/looma/components/ui-select/ui-select.html">
|
|
8
8
|
<link rel="component" href="@threadlabs/looma/components/ui-cluster/ui-cluster.html">
|
|
9
|
+
<link rel="component" href="@threadlabs/looma/components/ui-grid/ui-grid.html">
|
|
9
10
|
<link rel="component" href="@threadlabs/looma/components/ui-stack/ui-stack.html">
|
|
10
|
-
<template component="looma-catalog" module="./catalog-view.js"><defs></defs>
|
|
11
|
-
<ui-stack gap="xl"><ui-
|
|
11
|
+
<template component="looma-catalog" module="./catalog-view.js"><defs><prop name="category" type="string" default="">The category represented by this gallery.</prop><prop name="total" type="number" default="0">Number of cards before text filtering.</prop></defs>
|
|
12
|
+
<ui-stack gap="xl"><div $ref="filters" hidden><ui-grid columns="2" min="md"><ui-form-field><label slot="label" for="catalog-query">Filter components</label><ui-input id="catalog-query" $ref="query" type="search" placeholder="Name, tag or purpose"></ui-input></ui-form-field><ui-cluster align="end"><ui-form-field><label slot="label" for="catalog-category">Section</label><ui-select id="catalog-category" $ref="category"><option value="" data-href="${escape(base)}components/" from:selected="$category = ''">All sections</option>${groups.map(group => `<option value="${escape(group.id)}" data-href="${escape(base)}components/${escape(group.id)}/" from:selected="${escape(`$category = ${JSON.stringify(group.id)}`)}">${escape(group.label)}</option>`).join('')}</ui-select></ui-form-field></ui-cluster></ui-grid></div><p $ref="count" role="status" aria-live="polite">{$total} components</p><slot></slot></ui-stack></template>`;
|
|
12
13
|
}
|