@valbuild/react 0.126.0 → 0.128.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/CHANGELOG.md +51 -0
- package/dist/{raw-b5ef1ca2.cjs.dev.js → raw-512e7a0a.cjs.dev.js} +9 -0
- package/dist/{raw-7ab6ed4f.browser.esm.js → raw-57f19ada.browser.esm.js} +9 -0
- package/dist/{raw-d83a161a.esm.js → raw-7ce61255.esm.js} +9 -0
- package/dist/{raw-b9cef70c.worker.esm.js → raw-eede220f.worker.esm.js} +9 -0
- package/dist/{raw-791f5023.cjs.prod.js → raw-fe78b046.cjs.prod.js} +9 -0
- package/internal/dist/valbuild-react-internal.browser.esm.js +1 -1
- package/internal/dist/valbuild-react-internal.cjs.dev.js +1 -1
- package/internal/dist/valbuild-react-internal.cjs.prod.js +1 -1
- package/internal/dist/valbuild-react-internal.esm.js +1 -1
- package/internal/dist/valbuild-react-internal.worker.esm.js +1 -1
- package/package.json +4 -4
- package/stega/dist/valbuild-react-stega.browser.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.cjs.dev.js +1 -1
- package/stega/dist/valbuild-react-stega.cjs.prod.js +1 -1
- package/stega/dist/valbuild-react-stega.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.worker.esm.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @valbuild/react
|
|
2
2
|
|
|
3
|
+
## 0.128.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8b52b33`](https://github.com/valbuild/val/commit/8b52b33e1f629f14f66cc71dcc7cf415d210c7d4), [`362fb49`](https://github.com/valbuild/val/commit/362fb49f30d2b04c4ff78d54dca2bf5ad978a05c), [`c595799`](https://github.com/valbuild/val/commit/c59579977a436ec530c6c69f2b340ab9829d97ab)]:
|
|
8
|
+
- @valbuild/core@0.128.0
|
|
9
|
+
- @valbuild/shared@0.128.0
|
|
10
|
+
- @valbuild/ui@0.127.0
|
|
11
|
+
|
|
12
|
+
## 0.127.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#608](https://github.com/valbuild/val/pull/608) [`5b7fe05`](https://github.com/valbuild/val/commit/5b7fe05cec6365f9cd1de9ba31e65ed4a87edb63) Thanks [@freekh](https://github.com/freekh)! - `s.locale()`: one of the project's languages.
|
|
17
|
+
|
|
18
|
+
The languages themselves are declared in the settings module (`locales.available`);
|
|
19
|
+
this says that a value is one of them.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// a field: everything in this entry is in this language
|
|
23
|
+
s.record(s.string(), s.object({ locale: s.locale(), title: s.string() }));
|
|
24
|
+
|
|
25
|
+
// a key: one entry per language
|
|
26
|
+
s.record(s.locale(), s.object({ title: s.string() }));
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Every locale in content is checked against the project's list, the way `keyOf`
|
|
30
|
+
and `route` are checked against what they point at. An undeclared language names
|
|
31
|
+
the ones the project has; a project that has declared none is told to declare
|
|
32
|
+
them rather than told the value is wrong.
|
|
33
|
+
|
|
34
|
+
A locale is stored as the tag itself — the value in content is `nb-NO`, and a
|
|
35
|
+
record keyed by `s.locale()` has `nb-NO` as its key. Spelling one differently
|
|
36
|
+
where it is stored (`/no/…` as a URL segment) is a real need and is deliberately
|
|
37
|
+
not in this release: it changes what is accepted as well as what is shown, so it
|
|
38
|
+
is being designed on its own rather than folded in here.
|
|
39
|
+
|
|
40
|
+
A locale is **never stega encoded**: it ends up in `<html lang>`, in `hreflang`
|
|
41
|
+
and in `Intl` constructors, none of which survive invisible characters.
|
|
42
|
+
|
|
43
|
+
`assistant.translation` joins the settings module alongside `context` and `tone`
|
|
44
|
+
— a note per language, keyed by language, so only the target language's rules are
|
|
45
|
+
sent when translating into it.
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`7fa8699`](https://github.com/valbuild/val/commit/7fa869974bc895af992a7d5c18b76253636d7d65), [`600308d`](https://github.com/valbuild/val/commit/600308d0174990ad9f5c417147d160273489c65a), [`5b7fe05`](https://github.com/valbuild/val/commit/5b7fe05cec6365f9cd1de9ba31e65ed4a87edb63), [`88262ac`](https://github.com/valbuild/val/commit/88262ac8db068650a664981ef73556457d87741a), [`7072e07`](https://github.com/valbuild/val/commit/7072e07623c953a09ac14388ae22dada0b431ce3), [`29811c3`](https://github.com/valbuild/val/commit/29811c3f8c7e001a950e6f4833af6888e6a4efea), [`9983116`](https://github.com/valbuild/val/commit/99831164c5151aad7ca69de79e1d0d59878be251)]:
|
|
50
|
+
- @valbuild/core@0.127.0
|
|
51
|
+
- @valbuild/shared@0.127.0
|
|
52
|
+
- @valbuild/ui@0.127.0
|
|
53
|
+
|
|
3
54
|
## 0.126.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
|
@@ -265,6 +265,12 @@ function stegaEncode(input, opts) {
|
|
|
265
265
|
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isCodeSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
266
266
|
return sourceOrSelector;
|
|
267
267
|
}
|
|
268
|
+
// A locale ends up in `<html lang>`, in `hreflang`, and in `Intl`
|
|
269
|
+
// constructors. None of those survive invisible characters: the attribute
|
|
270
|
+
// carries them into the markup, and `Intl` throws on a tag it cannot parse.
|
|
271
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isLocaleSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
272
|
+
return sourceOrSelector;
|
|
273
|
+
}
|
|
268
274
|
// An enum value is one of a fixed set of strings, and consumer code
|
|
269
275
|
// compares against those strings. Weaving stega into it would break every
|
|
270
276
|
// such comparison, so it is handed back verbatim — as a literal is.
|
|
@@ -373,6 +379,9 @@ function isDateTimeSchema(schema) {
|
|
|
373
379
|
function isColorSchema(schema) {
|
|
374
380
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "color";
|
|
375
381
|
}
|
|
382
|
+
function isLocaleSchema(schema) {
|
|
383
|
+
return (schema === null || schema === void 0 ? void 0 : schema.type) === "locale";
|
|
384
|
+
}
|
|
376
385
|
function isCodeSchema(schema) {
|
|
377
386
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "code";
|
|
378
387
|
}
|
|
@@ -263,6 +263,12 @@ function stegaEncode(input, opts) {
|
|
|
263
263
|
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isCodeSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
264
264
|
return sourceOrSelector;
|
|
265
265
|
}
|
|
266
|
+
// A locale ends up in `<html lang>`, in `hreflang`, and in `Intl`
|
|
267
|
+
// constructors. None of those survive invisible characters: the attribute
|
|
268
|
+
// carries them into the markup, and `Intl` throws on a tag it cannot parse.
|
|
269
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isLocaleSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
270
|
+
return sourceOrSelector;
|
|
271
|
+
}
|
|
266
272
|
// An enum value is one of a fixed set of strings, and consumer code
|
|
267
273
|
// compares against those strings. Weaving stega into it would break every
|
|
268
274
|
// such comparison, so it is handed back verbatim — as a literal is.
|
|
@@ -371,6 +377,9 @@ function isDateTimeSchema(schema) {
|
|
|
371
377
|
function isColorSchema(schema) {
|
|
372
378
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "color";
|
|
373
379
|
}
|
|
380
|
+
function isLocaleSchema(schema) {
|
|
381
|
+
return (schema === null || schema === void 0 ? void 0 : schema.type) === "locale";
|
|
382
|
+
}
|
|
374
383
|
function isCodeSchema(schema) {
|
|
375
384
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "code";
|
|
376
385
|
}
|
|
@@ -263,6 +263,12 @@ function stegaEncode(input, opts) {
|
|
|
263
263
|
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isCodeSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
264
264
|
return sourceOrSelector;
|
|
265
265
|
}
|
|
266
|
+
// A locale ends up in `<html lang>`, in `hreflang`, and in `Intl`
|
|
267
|
+
// constructors. None of those survive invisible characters: the attribute
|
|
268
|
+
// carries them into the markup, and `Intl` throws on a tag it cannot parse.
|
|
269
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isLocaleSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
270
|
+
return sourceOrSelector;
|
|
271
|
+
}
|
|
266
272
|
// An enum value is one of a fixed set of strings, and consumer code
|
|
267
273
|
// compares against those strings. Weaving stega into it would break every
|
|
268
274
|
// such comparison, so it is handed back verbatim — as a literal is.
|
|
@@ -371,6 +377,9 @@ function isDateTimeSchema(schema) {
|
|
|
371
377
|
function isColorSchema(schema) {
|
|
372
378
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "color";
|
|
373
379
|
}
|
|
380
|
+
function isLocaleSchema(schema) {
|
|
381
|
+
return (schema === null || schema === void 0 ? void 0 : schema.type) === "locale";
|
|
382
|
+
}
|
|
374
383
|
function isCodeSchema(schema) {
|
|
375
384
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "code";
|
|
376
385
|
}
|
|
@@ -263,6 +263,12 @@ function stegaEncode(input, opts) {
|
|
|
263
263
|
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isCodeSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
264
264
|
return sourceOrSelector;
|
|
265
265
|
}
|
|
266
|
+
// A locale ends up in `<html lang>`, in `hreflang`, and in `Intl`
|
|
267
|
+
// constructors. None of those survive invisible characters: the attribute
|
|
268
|
+
// carries them into the markup, and `Intl` throws on a tag it cannot parse.
|
|
269
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isLocaleSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
270
|
+
return sourceOrSelector;
|
|
271
|
+
}
|
|
266
272
|
// An enum value is one of a fixed set of strings, and consumer code
|
|
267
273
|
// compares against those strings. Weaving stega into it would break every
|
|
268
274
|
// such comparison, so it is handed back verbatim — as a literal is.
|
|
@@ -371,6 +377,9 @@ function isDateTimeSchema(schema) {
|
|
|
371
377
|
function isColorSchema(schema) {
|
|
372
378
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "color";
|
|
373
379
|
}
|
|
380
|
+
function isLocaleSchema(schema) {
|
|
381
|
+
return (schema === null || schema === void 0 ? void 0 : schema.type) === "locale";
|
|
382
|
+
}
|
|
374
383
|
function isCodeSchema(schema) {
|
|
375
384
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "code";
|
|
376
385
|
}
|
|
@@ -265,6 +265,12 @@ function stegaEncode(input, opts) {
|
|
|
265
265
|
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isCodeSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
266
266
|
return sourceOrSelector;
|
|
267
267
|
}
|
|
268
|
+
// A locale ends up in `<html lang>`, in `hreflang`, and in `Intl`
|
|
269
|
+
// constructors. None of those survive invisible characters: the attribute
|
|
270
|
+
// carries them into the markup, and `Intl` throws on a tag it cannot parse.
|
|
271
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.schema && isLocaleSchema(recOpts === null || recOpts === void 0 ? void 0 : recOpts.schema)) {
|
|
272
|
+
return sourceOrSelector;
|
|
273
|
+
}
|
|
268
274
|
// An enum value is one of a fixed set of strings, and consumer code
|
|
269
275
|
// compares against those strings. Weaving stega into it would break every
|
|
270
276
|
// such comparison, so it is handed back verbatim — as a literal is.
|
|
@@ -373,6 +379,9 @@ function isDateTimeSchema(schema) {
|
|
|
373
379
|
function isColorSchema(schema) {
|
|
374
380
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "color";
|
|
375
381
|
}
|
|
382
|
+
function isLocaleSchema(schema) {
|
|
383
|
+
return (schema === null || schema === void 0 ? void 0 : schema.type) === "locale";
|
|
384
|
+
}
|
|
376
385
|
function isCodeSchema(schema) {
|
|
377
386
|
return (schema === null || schema === void 0 ? void 0 : schema.type) === "code";
|
|
378
387
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as _arrayLikeToArray, b as _unsupportedIterableToArray } from '../../dist/slicedToArray-9cce0d9f.browser.esm.js';
|
|
2
|
-
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-57f19ada.browser.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '@valbuild/core';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-e9e8e991.cjs.dev.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-512e7a0a.cjs.dev.js');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
9
9
|
require('@valbuild/core');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-86004d59.cjs.prod.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-fe78b046.cjs.prod.js');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
9
9
|
require('@valbuild/core');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as _arrayLikeToArray, b as _unsupportedIterableToArray } from '../../dist/slicedToArray-0c0a3b4a.esm.js';
|
|
2
|
-
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-7ce61255.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '@valbuild/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as _arrayLikeToArray, b as _unsupportedIterableToArray } from '../../dist/slicedToArray-7d0170b6.worker.esm.js';
|
|
2
|
-
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { d as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-eede220f.worker.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '@valbuild/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Val - React internal helpers",
|
|
6
6
|
"repository": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@vercel/stega": "^1.1.0",
|
|
13
13
|
"base64-arraybuffer": "^1.0.2",
|
|
14
|
-
"@valbuild/core": "0.
|
|
15
|
-
"@valbuild/shared": "0.
|
|
16
|
-
"@valbuild/ui": "0.
|
|
14
|
+
"@valbuild/core": "0.128.0",
|
|
15
|
+
"@valbuild/shared": "0.128.0",
|
|
16
|
+
"@valbuild/ui": "0.127.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@testing-library/react": "^16.3.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as _typeof, _ as _slicedToArray } from '../../dist/slicedToArray-9cce0d9f.browser.esm.js';
|
|
2
|
-
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-
|
|
3
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
2
|
+
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-57f19ada.browser.esm.js';
|
|
3
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-57f19ada.browser.esm.js';
|
|
4
4
|
import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
5
5
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
6
6
|
import React from 'react';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-e9e8e991.cjs.dev.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-512e7a0a.cjs.dev.js');
|
|
7
7
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
8
8
|
var jsxRuntimeDev = require('react/jsx-dev-runtime');
|
|
9
9
|
var React = require('react');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-86004d59.cjs.prod.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-fe78b046.cjs.prod.js');
|
|
7
7
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
8
8
|
var jsxRuntimeDev = require('react/jsx-dev-runtime');
|
|
9
9
|
var React = require('react');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as _typeof, _ as _slicedToArray } from '../../dist/slicedToArray-0c0a3b4a.esm.js';
|
|
2
|
-
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-
|
|
3
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
2
|
+
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-7ce61255.esm.js';
|
|
3
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-7ce61255.esm.js';
|
|
4
4
|
import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
5
5
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
6
6
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as _typeof, _ as _slicedToArray } from '../../dist/slicedToArray-7d0170b6.worker.esm.js';
|
|
2
|
-
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-
|
|
3
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
2
|
+
import { s as stegaDecodeStrings, _ as _createForOfIteratorHelper } from '../../dist/raw-eede220f.worker.esm.js';
|
|
3
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-eede220f.worker.esm.js';
|
|
4
4
|
import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
5
5
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
6
6
|
import React from 'react';
|