@ascribed/elements 0.2.1-next.15 → 0.2.1-next.16

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.
Files changed (3) hide show
  1. package/CONTRACT.md +5 -5
  2. package/README.md +6 -89
  3. package/package.json +2 -2
package/CONTRACT.md CHANGED
@@ -31,7 +31,7 @@ A change to this contract changes the site emitter (`crates/ascribe-emit`), the
31
31
 
32
32
  **Plain text of inline content.** Where an attribute holds a title or label written as inline markdown, its value is the inline content's text: phrases substituted (they already are, in the resolved page), code spans as their text, emphasis and links as their text, images as their alt text, raw inline HTML dropped, and line breaks as single spaces. So ``.Try the *new* `quill` CLI`` becomes `Try the new quill CLI`.
33
33
 
34
- **Labels** come from the content model: note types' `label` (docs/content/contracts/content-model.md §11), dimensions' and dimension values' `labels` (§7), and lifecycle states' `label` (§9). A value without a declared label is shown as itself.
34
+ **Labels** come from the content model: note types' `label` (docs/content/contracts/content-model.md §10), dimensions' and dimension values' `labels` (§6), and lifecycle states' `label` (§8). A value without a declared label is shown as itself.
35
35
 
36
36
  ## 1. `<ascribe-note>`
37
37
 
@@ -201,7 +201,7 @@ The element library may style `details` and `summary`, and implements no element
201
201
 
202
202
  ## 6. Project widgets
203
203
 
204
- A project widget (SPEC §6) becomes a custom element whose tag is the widget's name (SPEC §9.4). Widget names are valid custom-element names: they contain a hyphen, and docs/content/contracts/content-model.md §15 rejects names starting with `ascribe-` and HTML's reserved names. The project supplies the element's implementation; the element library doesn't.
204
+ A project widget (SPEC §6) becomes a custom element whose tag is the widget's name (SPEC §9.4). Widget names are valid custom-element names: they contain a hyphen, and docs/content/contracts/content-model.md §14 rejects names starting with `ascribe-` and HTML's reserved names. The project supplies the element's implementation; the element library doesn't.
205
205
 
206
206
  **Attributes**, in this order:
207
207
 
@@ -209,7 +209,7 @@ A project widget (SPEC §6) becomes a custom element whose tag is the widget's n
209
209
  2. `primary`: an identifier primary, if the widget takes one and it's given. A text primary is content instead (below).
210
210
  3. Each attribute in the widget's declaration, in declared order, with the value given or, if absent, its declared default. A value set's members are joined by single spaces; booleans are `true` or `false`; other values are their text. An attribute with neither a value nor a default is left out. A declaration can't use `heading`, `primary`, or HTML's global or event-handler attribute names (SPEC §7.2; content-model.md, `model-attribute-reserved`), so these never clash.
211
211
 
212
- **Children and placement**, by the widget's form and binding (docs/content/contracts/content-model.md §15):
212
+ **Children and placement**, by the widget's form and binding (docs/content/contracts/content-model.md §14):
213
213
 
214
214
  | Widget | Element |
215
215
  |---|---|
@@ -225,7 +225,7 @@ A wrapping widget follows §0's layout for elements that wrap markdown; an empty
225
225
 
226
226
  ## 7. Glossary terms
227
227
 
228
- There's no element for glossary terms. In the site output, an occurrence the glossary links (docs/content/contracts/content-model.md §13) is an ordinary markdown link to the term's `link` target, as a route, with the term's definition as the link title, followed directly by an attribute marker (docs/content/contracts/site-render.md §2.3) that gives the `<a>` a `data-ascribe-term` attribute holding the term's id:
228
+ There's no element for glossary terms. In the site output, an occurrence the glossary links (docs/content/contracts/content-model.md §12) is an ordinary markdown link to the term's `link` target, as a route, with the term's definition as the link title, followed directly by an attribute marker (docs/content/contracts/site-render.md §2.3) that gives the `<a>` a `data-ascribe-term` attribute holding the term's id:
229
229
 
230
230
  ```markdown
231
231
  [API key](/docs/reference/glossary/#api-key "A secret token that authenticates the Quill agent.")<ascribe-attributes data-ascribe-term="api-key"></ascribe-attributes>
@@ -241,7 +241,7 @@ Terms without a `link` stay plain text (content-model.md Q7).
241
241
 
242
242
  ## 8. `<ascribe-for-agents>`
243
243
 
244
- With `[consumer] agents = true` (docs/content/contracts/content-model.md §16), each page of the site output opens with a pointer for AI agents: where the index of every page, `llms.txt`, is, and where this page's Markdown version is (SPEC §9.4). It has no attributes, and wraps one paragraph of markdown with two links, both root-relative like every link in the site output:
244
+ With `[consumer] agents = true` (docs/content/contracts/content-model.md §15), each page of the site output opens with a pointer for AI agents: where the index of every page, `llms.txt`, is, and where this page's Markdown version is (SPEC §9.4). It has no attributes, and wraps one paragraph of markdown with two links, both root-relative like every link in the site output:
245
245
 
246
246
  ```markdown
247
247
  <ascribe-for-agents>
package/README.md CHANGED
@@ -34,95 +34,12 @@ choose("pm", "pnpm");
34
34
 
35
35
  ## Theming
36
36
 
37
- Set any of these custom properties on `:root`, or on any ancestor of the
38
- elements. Defaults are in `css/style.css`.
39
-
40
- The names are part of the [contract](CONTRACT.md) and don't change. The
41
- default values are Ascribe's design tokens, shared with review and the HTML
42
- report, and a release may change them; the changelog says so under **Behavior
43
- change**, with the previous values. A site that needs a fixed look sets the
44
- properties itself.
45
-
46
- | Group | Properties |
47
- |---|---|
48
- | Type | `--ascribe-font-family`, `--ascribe-font-size-small`, `--ascribe-font-weight-strong` |
49
- | Spacing and borders | `--ascribe-space`, `--ascribe-space-small`, `--ascribe-border-width`, `--ascribe-border-color`, `--ascribe-radius` |
50
- | Surfaces and text | `--ascribe-text-color`, `--ascribe-muted-color`, `--ascribe-surface-color` |
51
- | Notes | `--ascribe-<type>-color` and `--ascribe-<type>-background`, for `note`, `tip`, `important`, `warning`, and `caution` |
52
- | Steps | `--ascribe-steps-color`, `--ascribe-steps-marker-size`, `--ascribe-steps-marker-text-color` |
53
- | Tabs | `--ascribe-tab-color`, `--ascribe-tab-active-color`, `--ascribe-tab-focus-color`, `--ascribe-tab-hover-background` |
54
- | Availability | `--ascribe-state-color` and `--ascribe-state-background`, and `--ascribe-state-<state>-color` and `--ascribe-state-<state>-background` for `ga`, `preview`, `beta`, `deprecated`, and `removed` |
55
-
56
- ### Light and dark
57
-
58
- The default colors are light or dark as the page is. They're dark where the
59
- page's `color-scheme` is `dark`, or `light dark` while the reader's system is in
60
- dark mode, and light otherwise, including on a page that declares no
61
- `color-scheme`. So a site with a dark mode gets dark elements by declaring it:
62
-
63
- ```css
64
- :root {
65
- color-scheme: light dark;
66
- }
67
- ```
68
-
69
- A page whose colors don't follow its `color-scheme` sets
70
- `data-ascribe-scheme="light"` or `"dark"` on its root element, as the review
71
- marks read it. The defaults use CSS `light-dark()`; a browser without it shows
72
- the light colors. A property a site sets replaces both colors, so set it for
73
- each scheme when you set one:
74
-
75
- ```css
76
- :root {
77
- --ascribe-note-color: light-dark(#0550ae, #79c0ff);
78
- }
79
- ```
80
-
81
- ### Glossary terms
82
-
83
- A glossary link carries `data-ascribe-term` with the term's id, and its title
84
- is the definition. The library underlines it with dots; restyle it by
85
- selecting on the attribute, such as `a[data-ascribe-term]`.
86
-
87
- ### The pointer for agents
88
-
89
- With `[consumer] agents = true`, each page opens with `<ascribe-for-agents>`,
90
- which tells an AI agent where `llms.txt` and the page's Markdown are. The
91
- library hides it from sight, not from the page's text; to show it, restyle
92
- `ascribe-for-agents`.
93
-
94
- ### A project's own note types and lifecycle states
95
-
96
- Notes and availability targets carry their type or states as attributes, so a
97
- project styles its own by selecting on them. The elements take their colors
98
- from `--_color` and `--_background`:
99
-
100
- ```css
101
- ascribe-note[type="security"] {
102
- --_color: #b62324;
103
- --_background: #fff0f0;
104
- }
105
-
106
- ascribe-availability-target[states="sunset"],
107
- ascribe-availability-target[states$=" sunset"] {
108
- --_color: #6e7781;
109
- --_background: #eaeef2;
110
- }
111
- ```
112
-
113
- `states` lists a target's states in order and the last one styles the badge, so match it as a whole token, as above: `[states="x"], [states$=" x"]`. A bare `[states$="x"]` would also match a state named `pre-x`. Unknown types and states get the default (`note`, or the neutral state) style.
114
-
115
- ### Generated text
116
-
117
- Headings and labels come from the elements' attributes through CSS generated
118
- content, and the availability lead-in is `ascribe-availability::before`
119
- (`"Available: "`). A site can restyle or translate them:
120
-
121
- ```css
122
- ascribe-availability::before {
123
- content: "Disponible : ";
124
- }
125
- ```
37
+ The [element library reference](https://ascribed-dev.com/go/elements/) lists
38
+ the CSS custom properties that theme the elements, says what each one sets and
39
+ how they follow the page's light or dark scheme, and shows how to style your
40
+ own note types and lifecycle states. The properties' names are part of the
41
+ [contract](CONTRACT.md) and don't change; their defaults, in `css/style.css`,
42
+ may change in a release, as the changelog says.
126
43
 
127
44
  ## Tests
128
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascribed/elements",
3
- "version": "0.2.1-next.15",
3
+ "version": "0.2.1-next.16",
4
4
  "description": "Ascribe's web component library for the site output.",
5
5
  "type": "module",
6
6
  "license": "MPL-2.0",
@@ -36,7 +36,7 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "b4d4611f06c75553d379e3ad09a93b809071228f",
39
+ "gitHead": "0077fa1e1fcd4ef67f9c6d48575c3f06f98adce8",
40
40
  "scripts": {
41
41
  "build": "tsc -p tsconfig.build.json",
42
42
  "typecheck": "tsc --noEmit",