@localess/js-client 0.2.3-next.20241220-134926.0 → 0.2.3-next.20241220-135957.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/dist/cjs/client.d.ts +88 -0
- package/dist/cjs/client.js +170 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/editable.d.ts +7 -0
- package/dist/cjs/editable.js +10 -0
- package/dist/cjs/editable.js.map +1 -0
- package/dist/cjs/index.d.ts +20 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/models/content-asset.d.ts +13 -0
- package/dist/cjs/models/content-asset.js +3 -0
- package/dist/cjs/models/content-asset.js.map +1 -0
- package/dist/cjs/models/content-data.d.ts +4 -0
- package/dist/cjs/models/content-data.js +3 -0
- package/dist/cjs/models/content-data.js.map +1 -0
- package/dist/cjs/models/content-link.d.ts +21 -0
- package/dist/cjs/models/content-link.js +3 -0
- package/dist/cjs/models/content-link.js.map +1 -0
- package/dist/cjs/models/content-metadata.d.ts +41 -0
- package/dist/cjs/models/content-metadata.js +3 -0
- package/dist/cjs/models/content-metadata.js.map +1 -0
- package/dist/cjs/models/content-rich-text.d.ts +13 -0
- package/dist/cjs/models/content-rich-text.js +3 -0
- package/dist/cjs/models/content-rich-text.js.map +1 -0
- package/dist/cjs/models/content.d.ts +47 -0
- package/dist/cjs/models/content.js +3 -0
- package/dist/cjs/models/content.js.map +1 -0
- package/dist/cjs/models/index.d.ts +8 -0
- package/dist/cjs/models/index.js +25 -0
- package/dist/cjs/models/index.js.map +1 -0
- package/dist/cjs/models/links.d.ts +7 -0
- package/dist/cjs/models/links.js +3 -0
- package/dist/cjs/models/links.js.map +1 -0
- package/dist/cjs/models/translations.d.ts +6 -0
- package/dist/cjs/models/translations.js +3 -0
- package/dist/cjs/models/translations.js.map +1 -0
- package/dist/cjs/sync.d.ts +6 -0
- package/dist/cjs/sync.js +32 -0
- package/dist/cjs/sync.js.map +1 -0
- package/dist/cjs/utils.d.ts +40 -0
- package/dist/cjs/utils.js +51 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +163 -0
- package/dist/client.js.map +1 -0
- package/dist/editable.js +6 -0
- package/dist/editable.js.map +1 -0
- package/dist/index.js +5 -22076
- package/dist/index.js.map +1 -0
- package/dist/models/content-asset.js +2 -0
- package/dist/models/content-asset.js.map +1 -0
- package/dist/models/content-data.js +2 -0
- package/dist/models/content-data.js.map +1 -0
- package/dist/models/content-link.js +2 -0
- package/dist/models/content-link.js.map +1 -0
- package/dist/models/content-metadata.js +2 -0
- package/dist/models/content-metadata.js.map +1 -0
- package/dist/models/content-rich-text.js +2 -0
- package/dist/models/content-rich-text.js.map +1 -0
- package/dist/models/content.js +2 -0
- package/dist/models/content.js.map +1 -0
- package/dist/models/index.js +9 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/links.js +2 -0
- package/dist/models/links.js.map +1 -0
- package/dist/models/translations.js +2 -0
- package/dist/models/translations.js.map +1 -0
- package/dist/sync.js +28 -0
- package/dist/sync.js.map +1 -0
- package/dist/utils.js +47 -0
- package/dist/utils.js.map +1 -0
- package/package.json +10 -13
- package/dist/index.umd.cjs +0 -51
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-asset.js","sourceRoot":"","sources":["../../src/models/content-asset.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-data.js","sourceRoot":"","sources":["../../src/models/content-data.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-link.js","sourceRoot":"","sources":["../../src/models/content-link.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-metadata.js","sourceRoot":"","sources":["../../src/models/content-metadata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-rich-text.js","sourceRoot":"","sources":["../../src/models/content-rich-text.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/models/content.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './content';
|
|
2
|
+
export * from './content-asset';
|
|
3
|
+
export * from './content-data';
|
|
4
|
+
export * from './content-link';
|
|
5
|
+
export * from './content-metadata';
|
|
6
|
+
export * from './content-rich-text';
|
|
7
|
+
export * from './links';
|
|
8
|
+
export * from './translations';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/models/links.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../../src/models/translations.ts"],"names":[],"mappings":""}
|
package/dist/sync.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const JS_SYNC_ID = 'localess-js-sync';
|
|
2
|
+
/**
|
|
3
|
+
* Inject Localess Sync Script in Header
|
|
4
|
+
* @param {string} origin A fully qualified domain name with protocol (http/https) and port.
|
|
5
|
+
* @param {boolean} force Force Script Injection even if the application is not in Visual Editor.
|
|
6
|
+
*/
|
|
7
|
+
export function loadLocalessSync(origin, force = false) {
|
|
8
|
+
const isServer = typeof window === 'undefined';
|
|
9
|
+
if (isServer)
|
|
10
|
+
return; // Skip Server Injection
|
|
11
|
+
if (window.top === window.self)
|
|
12
|
+
return; // Skip if the page is not loaded in Visual Editor
|
|
13
|
+
const isSyncLoaded = typeof window.localess !== 'undefined';
|
|
14
|
+
if (isSyncLoaded)
|
|
15
|
+
return; // Skip if Sync is already loaded
|
|
16
|
+
const scriptEl = document.getElementById(JS_SYNC_ID);
|
|
17
|
+
if (scriptEl)
|
|
18
|
+
return; // Skip if script is already loaded
|
|
19
|
+
const script = document.createElement('script');
|
|
20
|
+
script.id = JS_SYNC_ID;
|
|
21
|
+
script.type = 'text/javascript';
|
|
22
|
+
script.src = `${origin}/scripts/sync-v1.js`;
|
|
23
|
+
script.async = true;
|
|
24
|
+
script.onerror = (error) => console.error(error);
|
|
25
|
+
script.onload = (event) => console.info('Localess Sync Script loaded');
|
|
26
|
+
document.head.appendChild(script);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=sync.js.map
|
package/dist/sync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAAiB,KAAK;IACrE,MAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;IAC/C,IAAI,QAAQ;QAAE,OAAO,CAAC,wBAAwB;IAC9C,IAAI,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI;QAAE,OAAO,CAAC,kDAAkD;IAC1F,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;IAC5D,IAAI,YAAY;QAAE,OAAO,CAAC,iCAAiC;IAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,QAAQ;QAAE,OAAO,CAAC,mCAAmC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;IACvB,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,qBAAqB,CAAA;IAC3C,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IAEpB,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAEvE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function proxyURIFromEnv() {
|
|
2
|
+
return (process.env.HTTPS_PROXY ||
|
|
3
|
+
process.env.https_proxy ||
|
|
4
|
+
process.env.HTTP_PROXY ||
|
|
5
|
+
process.env.http_proxy ||
|
|
6
|
+
undefined);
|
|
7
|
+
}
|
|
8
|
+
export const RESET = "\x1b[0m";
|
|
9
|
+
export const BRIGHT = "\x1b[1m";
|
|
10
|
+
export const DIM = "\x1b[2m";
|
|
11
|
+
export const UNDERSCORE = "\x1b[4m";
|
|
12
|
+
export const BLINK = "\x1b[5m";
|
|
13
|
+
export const REVERSE = "\x1b[7m";
|
|
14
|
+
export const HIDDEN = "\x1b[8m";
|
|
15
|
+
export const FG_BLACK = "\x1b[30m";
|
|
16
|
+
export const FG_RED = "\x1b[31m";
|
|
17
|
+
export const FG_GREEN = "\x1b[32m";
|
|
18
|
+
export const FG_YELLOW = "\x1b[33m";
|
|
19
|
+
export const FG_BLUE = "\x1b[34m";
|
|
20
|
+
export const FG_MAGENTA = "\x1b[35m";
|
|
21
|
+
export const FG_CYAN = "\x1b[36m";
|
|
22
|
+
export const FG_WHITE = "\x1b[37m";
|
|
23
|
+
export const FG_GRAY = "\x1b[90m";
|
|
24
|
+
export const FG_BRIGHT_RED = "\x1b[91m";
|
|
25
|
+
export const FG_BRIGHT_GREEN = "\x1b[92m";
|
|
26
|
+
export const FG_BRIGHT_YELLOW = "\x1b[93m";
|
|
27
|
+
export const FG_BRIGHT_BLUE = "\x1b[94m";
|
|
28
|
+
export const FG_BRIGHT_MAGENTA = "\x1b[95m";
|
|
29
|
+
export const FG_BRIGHT_CYAN = "\x1b[96m";
|
|
30
|
+
export const FG_BRIGHT_WHITE = "\x1b[97m";
|
|
31
|
+
export const BG_BLACK = "\x1b[40m";
|
|
32
|
+
export const BG_RED = "\x1b[41m";
|
|
33
|
+
export const BG_GREEN = "\x1b[42m";
|
|
34
|
+
export const BG_YELLOW = "\x1b[43m";
|
|
35
|
+
export const BG_BLUE = "\x1b[44m";
|
|
36
|
+
export const BG_MAGENTA = "\x1b[45m";
|
|
37
|
+
export const BG_CYAN = "\x1b[46m";
|
|
38
|
+
export const BG_WHITE = "\x1b[47m";
|
|
39
|
+
export const BG_GRAY = "\x1b[100m";
|
|
40
|
+
export const BG_BRIGHT_RED = "\x1b[101m";
|
|
41
|
+
export const BG_BRIGHT_GREEN = "\x1b[102m";
|
|
42
|
+
export const BG_BRIGHT_YELLOW = "\x1b[103m";
|
|
43
|
+
export const BG_BRIGHT_BLUE = "\x1b[104m";
|
|
44
|
+
export const BG_BRIGHT_MAGENTA = "\x1b[105m";
|
|
45
|
+
export const BG_BRIGHT_CYAN = "\x1b[106m";
|
|
46
|
+
export const B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AG,UAAU,CAAA;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAA;AACxC,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAA;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAA;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAA;AAEzC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA;AAClC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAA;AAChC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAA;AACjC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAA;AACpC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAA;AACjC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA;AAClC,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAA;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAA;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localess/js-client",
|
|
3
|
-
"version": "0.2.3-next.20241220-
|
|
3
|
+
"version": "0.2.3-next.20241220-135957.0",
|
|
4
4
|
"description": "Universal JavaScript/TypeScript SDK for Localess's API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"localess",
|
|
@@ -13,18 +13,19 @@
|
|
|
13
13
|
"author": "Lessify",
|
|
14
14
|
"homepage": "https://github.com/Lessify/localess-js-client",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"type": "module",
|
|
17
16
|
"files": [
|
|
18
17
|
"dist"
|
|
19
18
|
],
|
|
20
|
-
"main": "
|
|
21
|
-
"module": "
|
|
22
|
-
"types": "
|
|
19
|
+
"main": "dist/cjs/index.js",
|
|
20
|
+
"module": "dist/index.js",
|
|
21
|
+
"types": "dist/index.d.ts",
|
|
23
22
|
"exports": {
|
|
24
23
|
".": {
|
|
25
|
-
"types": "./dist/index.d.ts",
|
|
26
24
|
"import": "./dist/index.js",
|
|
27
|
-
"require": "./dist/index.
|
|
25
|
+
"require": "./dist/cjs/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js",
|
|
28
|
+
"node": "./dist/cjs/index.js"
|
|
28
29
|
},
|
|
29
30
|
"./models": "./dist/models/index.d.ts"
|
|
30
31
|
},
|
|
@@ -36,8 +37,7 @@
|
|
|
36
37
|
"url": "https://github.com/Lessify/localess-js-client/issues"
|
|
37
38
|
},
|
|
38
39
|
"scripts": {
|
|
39
|
-
"build
|
|
40
|
-
"build": "vite build",
|
|
40
|
+
"build": "npm run build:tsc && npm run build:cjs",
|
|
41
41
|
"build:tsc": "tsc -p tsconfig.json",
|
|
42
42
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
43
43
|
"build:tsup": "tsup-node --env.NODE_ENV production"
|
|
@@ -50,10 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^20.12.12",
|
|
52
52
|
"@types/node-fetch": "^2.5.12",
|
|
53
|
-
"typescript": "^5.0.0"
|
|
54
|
-
"vite": "^6.0.5",
|
|
55
|
-
"vite-plugin-dts": "^4.4.0",
|
|
56
|
-
"vitest": "^2.1.8"
|
|
53
|
+
"typescript": "^5.0.0"
|
|
57
54
|
},
|
|
58
55
|
"engines": {
|
|
59
56
|
"node": ">= 18.0.0"
|