livelocale 0.8.0 → 0.9.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/README.md +230 -5
- package/dist/client/index.cjs +178 -70
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +36 -22
- package/dist/client/index.d.ts +36 -22
- package/dist/client/index.js +177 -70
- package/dist/client/index.js.map +1 -1
- package/dist/codemod/index.cjs +3057 -152
- package/dist/codemod/index.cjs.map +1 -1
- package/dist/codemod/index.js +3058 -153
- package/dist/codemod/index.js.map +1 -1
- package/dist/react/index.cjs +185 -77
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +185 -77
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +108 -66
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +13 -3
- package/dist/server/index.d.ts +13 -3
- package/dist/server/index.js +107 -66
- package/dist/server/index.js.map +1 -1
- package/dist/studio/assets/index-Bvbtkry-.css +1 -0
- package/dist/studio/assets/index-DC_jRsox.js +13 -0
- package/dist/studio/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
- package/dist/studio/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
- package/dist/studio/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/dist/studio/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/dist/studio/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/dist/studio/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/dist/studio/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/dist/studio/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/dist/studio/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
- package/dist/studio/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
- package/dist/studio/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
- package/dist/studio/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
- package/dist/studio/assets/outfit-latin-500-normal-ClnHRwRh.woff +0 -0
- package/dist/studio/assets/outfit-latin-500-normal-DKnIMDSk.woff2 +0 -0
- package/dist/studio/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
- package/dist/studio/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
- package/dist/studio/assets/outfit-latin-700-normal-Cu9v6i1X.woff2 +0 -0
- package/dist/studio/assets/outfit-latin-700-normal-D4itBLBr.woff +0 -0
- package/dist/studio/index.html +3 -6
- package/dist/vite/index.cjs +739 -77
- package/dist/vite/index.cjs.map +1 -1
- package/dist/vite/index.d.cts +22 -2
- package/dist/vite/index.d.ts +22 -2
- package/dist/vite/index.js +738 -77
- package/dist/vite/index.js.map +1 -1
- package/dist/{wrap-CsOtHp8r.d.cts → wrap-2qVxLN9Q.d.cts} +10 -18
- package/dist/{wrap-CsOtHp8r.d.ts → wrap-2qVxLN9Q.d.ts} +10 -18
- package/package.json +4 -1
- package/dist/studio/assets/index-D7ifnqy5.js +0 -10
- package/dist/studio/assets/index-Zh0KtFUH.css +0 -2
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zero-Width Watermarking Encoder/Decoder
|
|
3
|
-
*
|
|
4
|
-
* Maps translation keys into invisible Unicode zero-width characters and
|
|
5
|
-
* prepends them as a binary watermark onto the translation string.
|
|
6
|
-
*
|
|
7
|
-
* Delimiters:
|
|
8
|
-
* \u200D – Zero-Width Joiner (ZWJ) → boundary start/end marker
|
|
9
|
-
* \u200B – Zero-Width Space (ZWS) → binary bit 0
|
|
10
|
-
* \u200C – Zero-Width Non-Joiner (ZWNJ) → binary bit 1
|
|
11
|
-
*
|
|
12
|
-
* The watermark is strictly prepended so it survives downstream truncation
|
|
13
|
-
* (e.g., text.substring()) that removes only from the right.
|
|
14
|
-
*/
|
|
15
1
|
/** Encodes a translation key as an invisible watermark prefix on `text`. */
|
|
16
2
|
declare function encodeKey(text: string, key: string): string;
|
|
17
3
|
/**
|
|
@@ -37,11 +23,17 @@ declare function stripWatermark(text: string): string;
|
|
|
37
23
|
/**
|
|
38
24
|
* Aggressively removes every zero-width character from `text`.
|
|
39
25
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
26
|
+
* This also removes ZWNJ and ZWSP that Persian, Urdu and Thai text needs, so
|
|
27
|
+
* prefer `removeWatermarks` for user-visible text and `stripWatermark` for
|
|
28
|
+
* translation content.
|
|
43
29
|
*/
|
|
44
30
|
declare function sanitizeZeroWidth(text: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Removes every complete watermark from `text`, wherever it occurs, and keeps
|
|
33
|
+
* all other zero-width characters. Persian and Urdu use ZWNJ inside words and
|
|
34
|
+
* Thai uses ZWSP, so stripping every zero-width character would corrupt them.
|
|
35
|
+
*/
|
|
36
|
+
declare function removeWatermarks(text: string): string;
|
|
45
37
|
/**
|
|
46
38
|
* Returns true if `text` begins with a valid watermark prefix.
|
|
47
39
|
*/
|
|
@@ -95,4 +87,4 @@ declare function wrapTranslationEngine<T extends object>(engine: T, options?: Wr
|
|
|
95
87
|
*/
|
|
96
88
|
declare function wrapNextIntl<T extends object>(t: T, namespace?: string): T;
|
|
97
89
|
|
|
98
|
-
export { type WrapOptions as W, stripWatermark as a, wrapTranslationEngine as b, decodeKey as d, encodeKey as e, hasWatermark as h, sanitizeZeroWidth as s, unwrap as u, wrapNextIntl as w };
|
|
90
|
+
export { type WrapOptions as W, stripWatermark as a, wrapTranslationEngine as b, decodeKey as d, encodeKey as e, hasWatermark as h, removeWatermarks as r, sanitizeZeroWidth as s, unwrap as u, wrapNextIntl as w };
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zero-Width Watermarking Encoder/Decoder
|
|
3
|
-
*
|
|
4
|
-
* Maps translation keys into invisible Unicode zero-width characters and
|
|
5
|
-
* prepends them as a binary watermark onto the translation string.
|
|
6
|
-
*
|
|
7
|
-
* Delimiters:
|
|
8
|
-
* \u200D – Zero-Width Joiner (ZWJ) → boundary start/end marker
|
|
9
|
-
* \u200B – Zero-Width Space (ZWS) → binary bit 0
|
|
10
|
-
* \u200C – Zero-Width Non-Joiner (ZWNJ) → binary bit 1
|
|
11
|
-
*
|
|
12
|
-
* The watermark is strictly prepended so it survives downstream truncation
|
|
13
|
-
* (e.g., text.substring()) that removes only from the right.
|
|
14
|
-
*/
|
|
15
1
|
/** Encodes a translation key as an invisible watermark prefix on `text`. */
|
|
16
2
|
declare function encodeKey(text: string, key: string): string;
|
|
17
3
|
/**
|
|
@@ -37,11 +23,17 @@ declare function stripWatermark(text: string): string;
|
|
|
37
23
|
/**
|
|
38
24
|
* Aggressively removes every zero-width character from `text`.
|
|
39
25
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
26
|
+
* This also removes ZWNJ and ZWSP that Persian, Urdu and Thai text needs, so
|
|
27
|
+
* prefer `removeWatermarks` for user-visible text and `stripWatermark` for
|
|
28
|
+
* translation content.
|
|
43
29
|
*/
|
|
44
30
|
declare function sanitizeZeroWidth(text: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Removes every complete watermark from `text`, wherever it occurs, and keeps
|
|
33
|
+
* all other zero-width characters. Persian and Urdu use ZWNJ inside words and
|
|
34
|
+
* Thai uses ZWSP, so stripping every zero-width character would corrupt them.
|
|
35
|
+
*/
|
|
36
|
+
declare function removeWatermarks(text: string): string;
|
|
45
37
|
/**
|
|
46
38
|
* Returns true if `text` begins with a valid watermark prefix.
|
|
47
39
|
*/
|
|
@@ -95,4 +87,4 @@ declare function wrapTranslationEngine<T extends object>(engine: T, options?: Wr
|
|
|
95
87
|
*/
|
|
96
88
|
declare function wrapNextIntl<T extends object>(t: T, namespace?: string): T;
|
|
97
89
|
|
|
98
|
-
export { type WrapOptions as W, stripWatermark as a, wrapTranslationEngine as b, decodeKey as d, encodeKey as e, hasWatermark as h, sanitizeZeroWidth as s, unwrap as u, wrapNextIntl as w };
|
|
90
|
+
export { type WrapOptions as W, stripWatermark as a, wrapTranslationEngine as b, decodeKey as d, encodeKey as e, hasWatermark as h, removeWatermarks as r, sanitizeZeroWidth as s, unwrap as u, wrapNextIntl as w };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livelocale",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Click any text in your running React app to edit its translation. Edits stay as JSON in git, or arrive as a pull request from a deployed preview. Local-first, zero-dependency.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Araby99",
|
|
@@ -105,6 +105,8 @@
|
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@changesets/cli": "^2.31.1",
|
|
108
|
+
"@fontsource/inter": "^5.3.0",
|
|
109
|
+
"@fontsource/outfit": "^5.3.0",
|
|
108
110
|
"@playwright/test": "^1.60.0",
|
|
109
111
|
"@tailwindcss/postcss": "^4.0.0",
|
|
110
112
|
"@testing-library/dom": "^10.4.2",
|
|
@@ -120,6 +122,7 @@
|
|
|
120
122
|
"clsx": "^2.1.1",
|
|
121
123
|
"eslint": "^9.39.4",
|
|
122
124
|
"eslint-plugin-react": "^7.37.5",
|
|
125
|
+
"fake-indexeddb": "^6.2.6",
|
|
123
126
|
"husky": "^9.1.7",
|
|
124
127
|
"jsdom": "^24.1.0",
|
|
125
128
|
"lint-staged": "^17.0.5",
|