solid-intlayer 8.5.1 → 8.5.2
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/editor/ContentSelector.cjs +1 -1
- package/dist/esm/editor/ContentSelector.mjs +15 -7
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/UI/ContentSelector.cjs +0 -1
- package/dist/esm/UI/ContentSelector.mjs +0 -58
- package/dist/types/UI/ContentSelector.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`@intlayer/editor/isEnabled`);var n=(0,e.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`@intlayer/editor/isEnabled`);var n=n=>t.isEnabled?(0,e.createComponent)(e.Dynamic,{component:`intlayer-content-selector-wrapper`,get"attr:key-path"(){return JSON.stringify(n.keyPath)},get"attr:dictionary-key"(){return n.dictionaryKey},get children(){return n.children}}):n.children;exports.ContentSelector=n;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isEnabled as
|
|
1
|
+
import { Dynamic as e, createComponent as t } from "solid-js/web";
|
|
2
|
+
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
3
3
|
//#region src/editor/ContentSelector.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var r = (r) => n ? t(e, {
|
|
5
|
+
component: "intlayer-content-selector-wrapper",
|
|
6
|
+
get "attr:key-path"() {
|
|
7
|
+
return JSON.stringify(r.keyPath);
|
|
8
|
+
},
|
|
9
|
+
get "attr:dictionary-key"() {
|
|
10
|
+
return r.dictionaryKey;
|
|
11
|
+
},
|
|
12
|
+
get children() {
|
|
13
|
+
return r.children;
|
|
14
|
+
}
|
|
15
|
+
}) : r.children;
|
|
8
16
|
//#endregion
|
|
9
|
-
export {
|
|
17
|
+
export { r as ContentSelector };
|
|
@@ -5,4 +5,4 @@ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/ty
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "is" | "id" | "
|
|
8
|
+
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "is" | "id" | "hr" | "th" | "tr" | "mi" | "mn" | "ms" | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is-IS" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi-NZ" | "mr" | "mr-IN" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA">>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);let e=require(`solid-js/web`),t=require(`solid-js`);var n=(0,e.template)(`<span role=button tabindex=0>`),r=250,i=i=>{let a,[o,s]=(0,t.createSignal)(!1),[c,l]=(0,t.createSignal)(i.isSelecting),u=null,d=typeof i.children==`string`,f=()=>{l(!0),i.onPress()},p=()=>{u=setTimeout(()=>{f()},i.pressDuration??r)},m=()=>{u&&=(clearTimeout(u),null)},h=()=>{m(),p()},g=()=>{s(!0),i.onHover?.()},_=()=>{s(!1),m()},v=e=>{a&&!a.contains(e.target)&&(l(!1),i.onClickOutside?.())};(0,t.createEffect)(()=>{document.addEventListener(`mousedown`,v),(0,t.onCleanup)(()=>{document.removeEventListener(`mousedown`,v),m()})});let y=e=>{c()&&(e.preventDefault(),e.stopPropagation())},b=()=>{l(!1)};return(()=>{var t=n(),r=a;return typeof r==`function`?(0,e.use)(r,t):a=t,t.addEventListener(`mouseenter`,g),t.addEventListener(`blur`,b),t.addEventListener(`touchcancel`,_),t.$$touchend=_,t.$$touchstart=h,t.addEventListener(`mouseleave`,_),t.$$mouseup=_,t.$$mousedown=h,t.$$click=y,t.$$keyup=()=>null,(0,e.spread)(t,(0,e.mergeProps)({get style(){return{display:d?`inline`:`inline-block`,cursor:`pointer`,"user-select":`none`,"border-radius":`0.375rem`,"outline-width":`2px`,"outline-offset":`4px`,"outline-style":`solid`,"outline-color":i.isSelecting||c()||o()?`inherit`:`transparent`,transition:`all 100ms 50ms ease-in-out`}}},i),!1,!0),(0,e.insert)(t,()=>i.children),t})()};(0,e.delegateEvents)([`keyup`,`click`,`mousedown`,`mouseup`,`touchstart`,`touchend`]),exports.ContentSelector=i;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { delegateEvents as e, insert as t, mergeProps as n, spread as r, template as i, use as a } from "solid-js/web";
|
|
2
|
-
import { createEffect as o, createSignal as s, onCleanup as c } from "solid-js";
|
|
3
|
-
//#region src/UI/ContentSelector.tsx
|
|
4
|
-
var l = /* @__PURE__ */ i("<span role=button tabindex=0>"), u = 250, d = (e) => {
|
|
5
|
-
let i, [d, f] = s(!1), [p, m] = s(e.isSelecting), h = null, g = typeof e.children == "string", _ = () => {
|
|
6
|
-
m(!0), e.onPress();
|
|
7
|
-
}, v = () => {
|
|
8
|
-
h = setTimeout(() => {
|
|
9
|
-
_();
|
|
10
|
-
}, e.pressDuration ?? u);
|
|
11
|
-
}, y = () => {
|
|
12
|
-
h &&= (clearTimeout(h), null);
|
|
13
|
-
}, b = () => {
|
|
14
|
-
y(), v();
|
|
15
|
-
}, x = () => {
|
|
16
|
-
f(!0), e.onHover?.();
|
|
17
|
-
}, S = () => {
|
|
18
|
-
f(!1), y();
|
|
19
|
-
}, C = (t) => {
|
|
20
|
-
i && !i.contains(t.target) && (m(!1), e.onClickOutside?.());
|
|
21
|
-
};
|
|
22
|
-
o(() => {
|
|
23
|
-
document.addEventListener("mousedown", C), c(() => {
|
|
24
|
-
document.removeEventListener("mousedown", C), y();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
let w = (e) => {
|
|
28
|
-
p() && (e.preventDefault(), e.stopPropagation());
|
|
29
|
-
}, T = () => {
|
|
30
|
-
m(!1);
|
|
31
|
-
};
|
|
32
|
-
return (() => {
|
|
33
|
-
var o = l(), s = i;
|
|
34
|
-
return typeof s == "function" ? a(s, o) : i = o, o.addEventListener("mouseenter", x), o.addEventListener("blur", T), o.addEventListener("touchcancel", S), o.$$touchend = S, o.$$touchstart = b, o.addEventListener("mouseleave", S), o.$$mouseup = S, o.$$mousedown = b, o.$$click = w, o.$$keyup = () => null, r(o, n({ get style() {
|
|
35
|
-
return {
|
|
36
|
-
display: g ? "inline" : "inline-block",
|
|
37
|
-
cursor: "pointer",
|
|
38
|
-
"user-select": "none",
|
|
39
|
-
"border-radius": "0.375rem",
|
|
40
|
-
"outline-width": "2px",
|
|
41
|
-
"outline-offset": "4px",
|
|
42
|
-
"outline-style": "solid",
|
|
43
|
-
"outline-color": e.isSelecting || p() || d() ? "inherit" : "transparent",
|
|
44
|
-
transition: "all 100ms 50ms ease-in-out"
|
|
45
|
-
};
|
|
46
|
-
} }, e), !1, !0), t(o, () => e.children), o;
|
|
47
|
-
})();
|
|
48
|
-
};
|
|
49
|
-
e([
|
|
50
|
-
"keyup",
|
|
51
|
-
"click",
|
|
52
|
-
"mousedown",
|
|
53
|
-
"mouseup",
|
|
54
|
-
"touchstart",
|
|
55
|
-
"touchend"
|
|
56
|
-
]);
|
|
57
|
-
//#endregion
|
|
58
|
-
export { d as ContentSelector };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, JSX } from 'solid-js';
|
|
2
|
-
type ContentSelectorProps = {
|
|
3
|
-
onPress: () => void;
|
|
4
|
-
onHover?: () => void;
|
|
5
|
-
onClickOutside?: () => void;
|
|
6
|
-
pressDuration?: number;
|
|
7
|
-
isSelecting?: boolean;
|
|
8
|
-
children?: JSX.Element;
|
|
9
|
-
} & JSX.HTMLAttributes<HTMLDivElement>;
|
|
10
|
-
export declare const ContentSelector: Component<ContentSelectorProps>;
|
|
11
|
-
export {};
|