@seamlet/astro 0.12.0 → 0.12.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 +1 -1
- package/dist/bridge.js +2 -2
- package/dist/{chunk-MW3BE5O6.js → chunk-SSECNMAD.js} +1 -1
- package/dist/{chunk-7GYJS7ZT.js → chunk-ZS32CW5F.js} +10 -4
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol.js +2 -2
- package/dist/schema.js +1 -1
- package/dist/site.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ export default defineSeamletSite({
|
|
|
178
178
|
});
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
A text with a link in a sentence, bold words or a list is one `richText` field, not a text cut around the link. Its value is data, never HTML: paragraphs (`{ kind: "paragraph", spans }`) and lists (`{ kind: "list", items }`) of pieces `{ text, bold?, italic?, href? }`, where `href` leads where a `link` may. `inline` keeps it one paragraph without lists, for a text inside an element that holds one line. A saved plain string is read as paragraphs, so a `text` field turned into `richText` keeps its words. Render it with the component of the package, which puts out paragraphs and lists (or, with `inline`, the words alone) and never raw HTML; style its elements from around it:
|
|
181
|
+
A text with a link in a sentence, bold words or a list is one `richText` field, not a text cut around the link. Its value is data, never HTML: paragraphs (`{ kind: "paragraph", spans }`) and lists (`{ kind: "list", items }`) of pieces `{ text, bold?, italic?, href? }`, where `href` leads where a `link` may. `inline` keeps it one paragraph without lists, for a text inside an element that holds one line. A saved plain string is read as paragraphs, so a `text` field turned into `richText` keeps its words, and a `richText` turned into `text` keeps them too, without their marks. Which texts to make formatted: prose (a lead, a description, a paragraph about the place) is `richText`; headings, names of records, the words of buttons and links, contacts and short labels stay `text`, so the owner meets one rule: a paragraph can be formatted, the rest is typed as it is. Give every mark a style the site's fonts can show: a font without an italic needs another way to show `<em>` (another family's italic, a colour), or the owner presses «К» and sees nothing. Render it with the component of the package, which puts out paragraphs and lists (or, with `inline`, the words alone) and never raw HTML; style its elements from around it:
|
|
182
182
|
|
|
183
183
|
```astro
|
|
184
184
|
---
|
package/dist/bridge.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
shortcutOf,
|
|
19
19
|
toggleList,
|
|
20
20
|
toggleMark
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SSECNMAD.js";
|
|
22
22
|
import {
|
|
23
23
|
FIELD_PATH_ATTRIBUTE,
|
|
24
24
|
REVEALED_ATTRIBUTE,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
readRichText,
|
|
29
29
|
resolveFieldPath,
|
|
30
30
|
safeHref
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZS32CW5F.js";
|
|
32
32
|
|
|
33
33
|
// src/bridge/typed-fields.ts
|
|
34
34
|
function typedKindAt(schema, path) {
|
|
@@ -558,17 +558,23 @@ function parseField(field, input, path) {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
function parseText(field, input, path) {
|
|
561
|
-
|
|
561
|
+
const typed = typedTextOf(input);
|
|
562
|
+
if (typed === void 0) {
|
|
562
563
|
return invalidType(defaultValue(field), path);
|
|
563
564
|
}
|
|
564
|
-
const isTooLong = field.maxLength !== void 0 && countCharacters(
|
|
565
|
+
const isTooLong = field.maxLength !== void 0 && countCharacters(typed) > field.maxLength;
|
|
565
566
|
if (isTooLong) {
|
|
566
567
|
return {
|
|
567
|
-
value:
|
|
568
|
+
value: typed,
|
|
568
569
|
issues: [{ path, code: "too-long", maxLength: field.maxLength }]
|
|
569
570
|
};
|
|
570
571
|
}
|
|
571
|
-
return valid(
|
|
572
|
+
return valid(typed);
|
|
573
|
+
}
|
|
574
|
+
function typedTextOf(input) {
|
|
575
|
+
if (typeof input === "string") return input;
|
|
576
|
+
const formatted = readRichText(input);
|
|
577
|
+
return formatted === void 0 ? void 0 : plainTextOf(formatted);
|
|
572
578
|
}
|
|
573
579
|
function parseRichText(field, input, path) {
|
|
574
580
|
const read2 = typeof input === "string" ? richTextOf(input) : readRichText(input);
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/dist/protocol.js
CHANGED
package/dist/schema.js
CHANGED
package/dist/site.js
CHANGED
package/package.json
CHANGED