@plitzi/sdk-shared 0.37.1 → 0.37.3
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 +1288 -0
- package/dist/actions/access.d.ts +12 -0
- package/dist/actions/access.mjs +13 -0
- package/dist/actions/cron.d.ts +21 -12
- package/dist/actions/cron.mjs +48 -17
- package/dist/actions/functions.d.ts +27 -0
- package/dist/actions/functions.mjs +18 -0
- package/dist/actions/index.d.ts +5 -1
- package/dist/actions/index.mjs +9 -7
- package/dist/actions/triggers.d.ts +4 -0
- package/dist/actions/triggers.mjs +4 -1
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.mjs +2 -1
- package/dist/auth/visitorRoles.d.ts +27 -0
- package/dist/auth/visitorRoles.mjs +48 -0
- package/dist/authoring/builder.mjs +1 -0
- package/dist/authoring/declare.d.ts +74 -0
- package/dist/authoring/declare.mjs +2 -2
- package/dist/authoring/index.mjs +5 -5
- package/dist/authoring/paramSpec.d.ts +1 -1
- package/dist/authoring/paramSpec.mjs +1 -0
- package/dist/authoring/spaceCallbacks.mjs +2 -2
- package/dist/dataSource/computed.d.ts +21 -0
- package/dist/dataSource/computed.mjs +45 -0
- package/dist/dataSource/getBindingsDetails.mjs +35 -33
- package/dist/dataSource/index.d.ts +1 -0
- package/dist/dataSource/index.mjs +7 -6
- package/dist/dataSource/utility/checkboxParams.d.ts +11 -0
- package/dist/dataSource/utility/checkboxParams.mjs +12 -0
- package/dist/dataSource/utility/not.mjs +4 -7
- package/dist/dataSource/utility/stringToArray.mjs +1 -1
- package/dist/dataSource/utility/truthiness.d.ts +1 -0
- package/dist/dataSource/utility/truthiness.mjs +8 -0
- package/dist/dataSource/utility/twigTemplate.d.ts +2 -1
- package/dist/dataSource/utility/twigTemplate.mjs +29 -17
- package/dist/devTools/utils/PlitziConsole.mjs +22 -22
- package/dist/helpers/cookies.d.ts +10 -0
- package/dist/helpers/cookies.mjs +19 -0
- package/dist/helpers/fetchManifest.d.ts +9 -0
- package/dist/helpers/fetchManifest.mjs +3 -6
- package/dist/helpers/formatDate.d.ts +5 -3
- package/dist/helpers/formatDate.mjs +34 -36
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.mjs +18 -13
- package/dist/helpers/isDate.d.ts +7 -0
- package/dist/helpers/isDate.mjs +15 -0
- package/dist/helpers/keys.d.ts +42 -0
- package/dist/helpers/keys.mjs +91 -0
- package/dist/helpers/twigWrapper/AST.d.ts +2 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.d.ts +12 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +69 -31
- package/dist/helpers/twigWrapper/Evaluator/index.d.ts +1 -1
- package/dist/helpers/twigWrapper/Evaluator/index.mjs +2 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.d.ts +2 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +147 -34
- package/dist/helpers/twigWrapper/Parser/Parser.d.ts +2 -1
- package/dist/helpers/twigWrapper/Parser/Parser.mjs +21 -20
- package/dist/helpers/twigWrapper/filters/filters.mjs +134 -111
- package/dist/helpers/twigWrapper/index.d.ts +6 -2
- package/dist/helpers/twigWrapper/index.mjs +7 -4
- package/dist/helpers/twigWrapper/inspectTemplate.d.ts +23 -0
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +110 -0
- package/dist/helpers/twigWrapper/processTwig/helpers.d.ts +7 -0
- package/dist/helpers/twigWrapper/processTwig/helpers.mjs +2 -1
- package/dist/helpers/twigWrapper/processTwig/index.d.ts +2 -1
- package/dist/helpers/twigWrapper/processTwig/index.mjs +3 -2
- package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +28 -0
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +73 -16
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.d.ts +17 -0
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +14 -0
- package/dist/helpers/twigWrapper/templateRoots.d.ts +11 -0
- package/dist/helpers/twigWrapper/templateRoots.mjs +4 -4
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.d.ts +9 -0
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +4 -0
- package/dist/history/describe.d.ts +29 -0
- package/dist/history/describe.mjs +93 -0
- package/dist/history/diff.d.ts +33 -0
- package/dist/history/diff.mjs +73 -0
- package/dist/history/index.d.ts +3 -0
- package/dist/history/index.mjs +3 -0
- package/dist/history/types.d.ts +48 -0
- package/dist/history/types.mjs +0 -0
- package/dist/hooks/usePlitziServiceContext.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +77 -65
- package/dist/navigation/index.d.ts +1 -1
- package/dist/navigation/index.mjs +2 -2
- package/dist/navigation/routes.d.ts +11 -1
- package/dist/navigation/routes.mjs +35 -30
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.d.ts +14 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +2 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.d.ts +3 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.d.ts +11 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +24 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +28 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +108 -84
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.d.ts +23 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +49 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +13 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.d.ts +17 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +22 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +32 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +16 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +17 -3
- package/dist/network/graphql/builder/Queries/index.mjs +30 -22
- package/dist/network/graphql/sdk/Mutations/index.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +2 -91
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +2 -44
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +2 -55
- package/dist/network/graphql/sdk/Queries/index.d.ts +1 -5
- package/dist/network/index.mjs +7 -7
- package/dist/network/spaceEvents.d.ts +33 -3
- package/dist/network/spaceEvents.mjs +102 -89
- package/dist/realtime/client.d.ts +46 -0
- package/dist/realtime/client.mjs +192 -0
- package/dist/realtime/index.d.ts +6 -0
- package/dist/realtime/index.mjs +4 -0
- package/dist/realtime/presence.d.ts +38 -0
- package/dist/realtime/presence.mjs +70 -0
- package/dist/realtime/topics.d.ts +36 -0
- package/dist/realtime/topics.mjs +25 -0
- package/dist/schema/serverElements.d.ts +5 -0
- package/dist/schema/serverElements.mjs +15 -14
- package/dist/server/actions/useRealtimeSync.d.ts +9 -0
- package/dist/server/actions/useRealtimeSync.mjs +7 -0
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.mjs +3 -2
- package/dist/state/paintedState.d.ts +52 -0
- package/dist/state/paintedState.mjs +37 -0
- package/dist/state/runtimeStatePersist.d.ts +24 -0
- package/dist/state/runtimeStatePersist.mjs +113 -10
- package/dist/store/index.d.ts +45 -45
- package/dist/store/renderSettings.d.ts +6 -3
- package/dist/store/tracing/index.d.ts +1 -0
- package/dist/store/tracing/tracingCollector.d.ts +17 -1
- package/dist/store/tracing/tracingCollector.mjs +5 -0
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.mjs +3 -2
- package/dist/style/runtimeStyle.d.ts +29 -0
- package/dist/style/runtimeStyle.mjs +7 -0
- package/dist/style/styleConstants.d.ts +3 -2
- package/dist/style/styleConstants.mjs +2 -0
- package/dist/style/styleStates.d.ts +14 -1
- package/dist/style/styleStates.mjs +10 -7
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.mjs +35 -29
- package/dist/theme/themeCookie.mjs +11 -15
- package/dist/types/ActionTypes.d.ts +193 -0
- package/dist/types/AuthTypes.d.ts +11 -1
- package/dist/types/CommonTypes.d.ts +6 -0
- package/dist/types/FunctionTypes.d.ts +52 -0
- package/dist/types/FunctionTypes.mjs +0 -0
- package/dist/types/PluginTypes.d.ts +0 -1
- package/dist/types/RealtimeTypes.d.ts +94 -0
- package/dist/types/RealtimeTypes.mjs +0 -0
- package/dist/types/SchemaTypes.d.ts +54 -0
- package/dist/types/SchemaTypes.mjs +8 -0
- package/dist/types/ServerTypes.d.ts +310 -15
- package/dist/types/SpaceTypes.d.ts +53 -0
- package/dist/types/StateTypes.d.ts +6 -0
- package/dist/types/StoreTypes.d.ts +12 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.mjs +3 -2
- package/package.json +190 -21
- package/vite.config.ts +0 -12
- package/dist/network/graphql/builder/Queries/PluginsQuery.d.ts +0 -9
- package/dist/network/graphql/builder/Queries/PluginsQuery.mjs +0 -54
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import e from "./utility/
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { isTrue as e } from "./utility/truthiness.mjs";
|
|
2
|
+
import t from "./utility/index.mjs";
|
|
3
|
+
import { checkboxParams as n } from "./utility/checkboxParams.mjs";
|
|
4
|
+
import { camelCase as r, get as i, set as a } from "@plitzi/plitzi-ui/helpers/lodash";
|
|
5
|
+
import { QueryBuilderEvaluator as o } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
6
|
+
import { produce as s } from "immer";
|
|
5
7
|
//#region src/dataSource/getBindingsDetails.ts
|
|
6
|
-
var
|
|
7
|
-
let o =
|
|
8
|
+
var c = (e, t, n, r, a) => {
|
|
9
|
+
let o = r === "initialState" ? `definition.${r}.${a}` : `${r}.${a}`;
|
|
8
10
|
return {
|
|
9
|
-
fromValue: t ?
|
|
10
|
-
toValue: n
|
|
11
|
+
fromValue: t ? i(e, t, i(n, o)) : void 0,
|
|
12
|
+
toValue: i(n, o, t ? i(e, t) : void 0)
|
|
11
13
|
};
|
|
12
|
-
},
|
|
13
|
-
let { attributes:
|
|
14
|
-
return !
|
|
15
|
-
attributes:
|
|
14
|
+
}, l = (l, u, d = {}) => {
|
|
15
|
+
let { attributes: f, definition: p } = u, { bindings: m } = p;
|
|
16
|
+
return !m || typeof m == "object" && !Object.keys(m).length ? {
|
|
17
|
+
attributes: f,
|
|
16
18
|
style: {},
|
|
17
|
-
definition:
|
|
18
|
-
} :
|
|
19
|
-
attributes:
|
|
20
|
-
style:
|
|
21
|
-
definition:
|
|
22
|
-
}, (
|
|
23
|
-
Object.keys(
|
|
24
|
-
|
|
25
|
-
let { source:
|
|
26
|
-
if (!
|
|
27
|
-
|
|
28
|
-
let { fromValue:
|
|
29
|
-
|
|
30
|
-
let { action: r, params: i, enabled:
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
...
|
|
35
|
-
sourceTo:
|
|
19
|
+
definition: p
|
|
20
|
+
} : s({
|
|
21
|
+
attributes: f,
|
|
22
|
+
style: d,
|
|
23
|
+
definition: p
|
|
24
|
+
}, (s) => {
|
|
25
|
+
Object.keys(m).forEach((u) => {
|
|
26
|
+
m[u] && Array.isArray(m[u]) && m[u].length && m[u].forEach((d) => {
|
|
27
|
+
let { source: f, transformers: p, when: m, enabled: h = !0 } = d, { to: g } = d;
|
|
28
|
+
if (!g || m && !o(m, l, !1, !0) || !h) return;
|
|
29
|
+
u === "style" && (g = r(g));
|
|
30
|
+
let { fromValue: _, toValue: v } = c(l, f, s, u, g), y = _;
|
|
31
|
+
p && Array.isArray(p) && p.length > 0 && p.forEach((e) => {
|
|
32
|
+
let { action: r, params: i, enabled: a = !0 } = e;
|
|
33
|
+
if (!a) return;
|
|
34
|
+
let o = t[r];
|
|
35
|
+
o && (y = o.callback(y, n(o, i) ?? {}, s, {
|
|
36
|
+
...l,
|
|
37
|
+
sourceTo: v
|
|
36
38
|
}));
|
|
37
|
-
}), (typeof
|
|
39
|
+
}), u === "initialState" && g === "visibility" && f && i(l, f) !== void 0 && (y = e(y)), (typeof y == "boolean" || typeof y == "number" || y) && (u === "initialState" ? a(s, `definition.${u}.${g}`, y) : a(s, `${u}.${g}`, y));
|
|
38
40
|
});
|
|
39
41
|
});
|
|
40
42
|
});
|
|
41
43
|
};
|
|
42
44
|
//#endregion
|
|
43
|
-
export {
|
|
45
|
+
export { l as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './hooks';
|
|
2
2
|
export * from './helpers';
|
|
3
|
+
export { evaluateComputed, liveSources } from './computed';
|
|
3
4
|
export { default as getBindingsDetails } from './getBindingsDetails';
|
|
4
5
|
export { default as resolveVariables } from './resolveVariables';
|
|
5
6
|
export type { VariableScope } from './resolveVariables';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import e,
|
|
2
|
-
import n from "./
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { evaluateComputed as e, liveSources as t } from "./computed.mjs";
|
|
2
|
+
import n, { utilityOptions as r } from "./utility/index.mjs";
|
|
3
|
+
import i from "./getBindingsDetails.mjs";
|
|
4
|
+
import a from "./helpers/getSourceName.mjs";
|
|
5
|
+
import o from "./hooks/useRegisterSource.mjs";
|
|
6
|
+
import s from "./resolveVariables.mjs";
|
|
7
|
+
export { e as evaluateComputed, i as getBindingsDetails, a as getSourceName, t as liveSources, s as resolveVariables, o as useRegisterSource, n as utility, r as utilityOptions };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataSourceUtility, DataSourceUtilityParamsValue } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* A checkbox param as the boolean it means.
|
|
4
|
+
*
|
|
5
|
+
* A document stores what an editor or an author wrote, and a checkbox arrives both ways: `true` from the builder,
|
|
6
|
+
* `'true'` or `'false'` from anything that writes params as text — an authored space, an export, an agent. A callback
|
|
7
|
+
* reading `if (asAge)` takes `'false'` for yes, so `dateConverter({ asAge: 'false' })` printed "3 days ago" and
|
|
8
|
+
* `isUnix: 'false'` parsed an ISO date as a number and gave the raw string back. Normalised once here, before any
|
|
9
|
+
* callback runs, every utility reads a checkbox the same way.
|
|
10
|
+
*/
|
|
11
|
+
export declare const checkboxParams: <TParams>(utility: Pick<DataSourceUtility<unknown, unknown, TParams>, "params">, params: DataSourceUtilityParamsValue<TParams> | undefined) => DataSourceUtilityParamsValue<TParams> | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/dataSource/utility/checkboxParams.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
if (!t) return t;
|
|
4
|
+
let n = t;
|
|
5
|
+
for (let [r, i] of Object.entries(e.params)) {
|
|
6
|
+
let e = t[r];
|
|
7
|
+
e !== "true" && e !== "false" || (typeof i.type == "function" ? i.type(t) : i.type) !== "checkbox" || (n === t && (n = { ...t }), n[r] = e === "true");
|
|
8
|
+
}
|
|
9
|
+
return n;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as checkboxParams };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { isTrue as e } from "./truthiness.mjs";
|
|
1
2
|
//#region src/dataSource/utility/not.ts
|
|
2
|
-
var
|
|
3
|
-
"false",
|
|
4
|
-
"0",
|
|
5
|
-
""
|
|
6
|
-
]), t = (t) => typeof t == "string" ? !e.has(t.trim().toLowerCase()) : Array.isArray(t) ? t.length > 0 : !!t, n = {
|
|
3
|
+
var t = {
|
|
7
4
|
action: "not",
|
|
8
5
|
title: "Not",
|
|
9
6
|
type: "utility",
|
|
10
7
|
params: {},
|
|
11
8
|
preview: { content: "" },
|
|
12
|
-
callback: (
|
|
9
|
+
callback: (t) => !e(t)
|
|
13
10
|
};
|
|
14
11
|
//#endregion
|
|
15
|
-
export {
|
|
12
|
+
export { t as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTrue: (value: unknown) => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { DataSourceUtility } from '../../types';
|
|
2
|
-
|
|
2
|
+
export type TwigTemplateReturnMode = 'text' | 'value';
|
|
3
|
+
declare const twigTemplate: DataSourceUtility<unknown, unknown, string>;
|
|
3
4
|
export default twigTemplate;
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import { processTwig as e } from "../../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
2
|
-
var
|
|
1
|
+
import { processTwig as e, processTwigValue as t } from "../../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
2
|
+
var n = {
|
|
3
3
|
action: "twigTemplate",
|
|
4
4
|
title: "Twig Template",
|
|
5
5
|
type: "utility",
|
|
6
|
-
params: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
params: {
|
|
7
|
+
template: {
|
|
8
|
+
label: "Template",
|
|
9
|
+
defaultValue: "Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",
|
|
10
|
+
type: "codemirror-text"
|
|
11
|
+
},
|
|
12
|
+
returnMode: {
|
|
13
|
+
label: "Returns",
|
|
14
|
+
defaultValue: "text",
|
|
15
|
+
type: "select",
|
|
16
|
+
options: [{
|
|
17
|
+
label: "Text",
|
|
18
|
+
value: "text"
|
|
19
|
+
}, {
|
|
20
|
+
label: "Value (a single {{ expression }})",
|
|
21
|
+
value: "value"
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
11
25
|
preview: { template: "" },
|
|
12
|
-
callback: (
|
|
13
|
-
let { template:
|
|
26
|
+
callback: (n, r, i, a = {}) => {
|
|
27
|
+
let { template: o, returnMode: s = "text" } = r, c = {
|
|
28
|
+
source: n,
|
|
29
|
+
...a
|
|
30
|
+
};
|
|
14
31
|
try {
|
|
15
|
-
|
|
16
|
-
source: t,
|
|
17
|
-
...i
|
|
18
|
-
});
|
|
19
|
-
(typeof n == "string" || typeof n == "object" && n) && (o = n);
|
|
32
|
+
return s === "value" ? t(o, c) : e(o, c);
|
|
20
33
|
} catch {
|
|
21
|
-
|
|
34
|
+
return n;
|
|
22
35
|
}
|
|
23
|
-
return o;
|
|
24
36
|
}
|
|
25
37
|
};
|
|
26
38
|
//#endregion
|
|
27
|
-
export {
|
|
39
|
+
export { n as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { formatDate as e } from "../../helpers/formatDate.mjs";
|
|
2
1
|
//#region src/devTools/utils/PlitziConsole.ts
|
|
3
|
-
var t = class {
|
|
2
|
+
var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}.${e(t.getMilliseconds(), 3)}`, n = () => typeof window < "u", r = class {
|
|
4
3
|
callbackInternal;
|
|
5
4
|
callbackAddProvider;
|
|
6
5
|
callbackRemoveProvider;
|
|
@@ -34,30 +33,31 @@ var t = class {
|
|
|
34
33
|
flush(e = !1) {
|
|
35
34
|
this.logsListened = [], e && (this.pendingLogs = []);
|
|
36
35
|
}
|
|
37
|
-
#n(e, t,
|
|
38
|
-
|
|
36
|
+
#n(e, t, r, i) {
|
|
37
|
+
if (!this.callbackInternal && !n()) return;
|
|
38
|
+
let a = this.getTime(!0);
|
|
39
39
|
if (!this.callbackInternal) {
|
|
40
40
|
this.pendingLogs.push({
|
|
41
41
|
logType: e,
|
|
42
42
|
category: t,
|
|
43
|
-
message:
|
|
44
|
-
params:
|
|
45
|
-
time:
|
|
43
|
+
message: r,
|
|
44
|
+
params: i,
|
|
45
|
+
time: a
|
|
46
46
|
}), this.pendingLogs.length > this.pendingLimit && this.pendingLogs.shift();
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
this.listening ? this.logsListened.push({
|
|
50
50
|
logType: e,
|
|
51
51
|
category: t,
|
|
52
|
-
message:
|
|
53
|
-
params:
|
|
54
|
-
time:
|
|
52
|
+
message: r,
|
|
53
|
+
params: i,
|
|
54
|
+
time: a
|
|
55
55
|
}) : (this.#e.push({
|
|
56
56
|
logType: e,
|
|
57
57
|
category: t,
|
|
58
|
-
message:
|
|
59
|
-
params:
|
|
60
|
-
time:
|
|
58
|
+
message: r,
|
|
59
|
+
params: i,
|
|
60
|
+
time: a
|
|
61
61
|
}), this.#r()), this.logsListened.length > this.logsListenedLimit && this.logsListened.shift();
|
|
62
62
|
}
|
|
63
63
|
#r() {
|
|
@@ -73,9 +73,9 @@ var t = class {
|
|
|
73
73
|
removeProviderMethod(e) {
|
|
74
74
|
typeof this.callbackRemoveProvider == "function" && this.callbackRemoveProvider(e);
|
|
75
75
|
}
|
|
76
|
-
getTime(
|
|
76
|
+
getTime(e = !1) {
|
|
77
77
|
let n = /* @__PURE__ */ new Date();
|
|
78
|
-
return
|
|
78
|
+
return e ? t(n) : n;
|
|
79
79
|
}
|
|
80
80
|
info(e, t, n) {
|
|
81
81
|
this.#n("info", e, t, n);
|
|
@@ -95,16 +95,16 @@ var t = class {
|
|
|
95
95
|
end() {
|
|
96
96
|
this.listening = !1, this.listeningCategory && this.logsListened.length > 0 && this.callbackInternal?.("info", this.listeningCategory, `${this.logsListened.length} Log${this.logsListened.length === 1 ? "" : "s"}`, { logs: this.logsListened }), this.logsListened = [], this.listeningCategory = void 0;
|
|
97
97
|
}
|
|
98
|
-
},
|
|
99
|
-
function
|
|
100
|
-
return ({ path: t, prevValue:
|
|
101
|
-
|
|
98
|
+
}, i = new r();
|
|
99
|
+
function a(e = "store") {
|
|
100
|
+
return ({ path: t, prevValue: n, nextValue: r }) => {
|
|
101
|
+
i.info("store", e, {
|
|
102
102
|
storeName: e,
|
|
103
103
|
path: t,
|
|
104
|
-
prev:
|
|
105
|
-
next:
|
|
104
|
+
prev: n,
|
|
105
|
+
next: r
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
|
-
export {
|
|
110
|
+
export { a as createStoreDevToolsLogger, r as default, i as pConsole };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One cookie's value out of a `Cookie` header — or out of `document.cookie`, which is written the same way.
|
|
3
|
+
*
|
|
4
|
+
* One function for both halves of the SDK, because the cookies it reads this way are the ones a server reads to render
|
|
5
|
+
* what the browser is about to hydrate: two parsers are two chances to disagree about a value, and a disagreement there
|
|
6
|
+
* is a page thrown away and drawn again. Undecodable values answer `undefined`, like absent ones.
|
|
7
|
+
*/
|
|
8
|
+
export declare const cookieFromHeader: (header: string | undefined, name: string) => string | undefined;
|
|
9
|
+
/** `document.cookie`, or nothing where there is no document or it may not be read (a sandboxed frame throws). */
|
|
10
|
+
export declare const documentCookies: () => string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/helpers/cookies.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
if (e) for (let n of e.split(";")) {
|
|
4
|
+
let e = n.indexOf("=");
|
|
5
|
+
if (e > -1 && n.slice(0, e).trim() === t) try {
|
|
6
|
+
return decodeURIComponent(n.slice(e + 1).trim());
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}, t = () => {
|
|
12
|
+
try {
|
|
13
|
+
return typeof document > "u" ? void 0 : document.cookie;
|
|
14
|
+
} catch {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as cookieFromHeader, t as documentCookies };
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin's `plugin-manifest.json`, or `undefined` when it cannot be had.
|
|
3
|
+
*
|
|
4
|
+
* Plugins live on hosts of their own — a CDN, a bucket, the builder's resources — so this is nearly always a
|
|
5
|
+
* cross-origin request, and it is kept a SIMPLE one: `Accept` says what is wanted, where the `Content-Type` this used to
|
|
6
|
+
* send (on a GET, with no body to describe) made the browser ask the host's permission first. A host that allows plain
|
|
7
|
+
* cross-origin reads — the usual CORS setting of a bucket — refused that preflight, and the element rendered "Not
|
|
8
|
+
* Found" with the manifest sitting right there.
|
|
9
|
+
*/
|
|
1
10
|
declare const fetchManifest: <T extends object>(manifestUrl: string) => Promise<T | undefined>;
|
|
2
11
|
export default fetchManifest;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
//#region src/helpers/fetchManifest.ts
|
|
2
2
|
var e = async (e) => {
|
|
3
|
-
let t;
|
|
4
3
|
try {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
headers: { "Content-Type": "application/json" }
|
|
8
|
-
})).json(), t;
|
|
4
|
+
let t = await fetch(e, { headers: { Accept: "application/json" } });
|
|
5
|
+
return t.ok ? await t.json() : void 0;
|
|
9
6
|
} catch {
|
|
10
|
-
return
|
|
7
|
+
return;
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
10
|
//#endregion
|
|
@@ -25,7 +25,11 @@ export declare const parseDate: (date: string | number | Date) => Date;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function formatDate(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
27
27
|
export declare function formatDateUTC(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Formats a UTC timestamp/string in the local timezone. A `Date` is an instant and `format` reads its local fields, so
|
|
30
|
+
* there is nothing to convert: moving it first is what printed the repeated hour at the end of daylight saving time an
|
|
31
|
+
* hour off.
|
|
32
|
+
*/
|
|
29
33
|
export declare function formatUTCToLocal(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
30
34
|
/**
|
|
31
35
|
* Returns the difference between two dates in milliseconds
|
|
@@ -52,5 +56,3 @@ export declare function getDurationMs(start: string | number | Date, end: string
|
|
|
52
56
|
export declare function formatFromNow(date?: string | number | Date, locale?: SupportedLocale, options?: FormatDistanceToNowOptions): string;
|
|
53
57
|
export declare function isValidFormat(formatStr: string): boolean;
|
|
54
58
|
export declare const toUnixSeconds: (input: string | number | Date) => string;
|
|
55
|
-
/** Strictly validates whether a string matches a given date-fns format. */
|
|
56
|
-
export declare function isDate(value: string, formatStr: string): boolean;
|
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import { differenceInMilliseconds as e
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { differenceInMilliseconds as e } from "date-fns/differenceInMilliseconds";
|
|
2
|
+
import { format as t } from "date-fns/format";
|
|
3
|
+
import { formatDistanceToNow as n } from "date-fns/formatDistanceToNow";
|
|
4
|
+
import { getTime as r } from "date-fns/getTime";
|
|
5
|
+
import { enUS as i } from "date-fns/locale/en-US";
|
|
6
|
+
import { es as a } from "date-fns/locale/es";
|
|
7
|
+
import { pt as o } from "date-fns/locale/pt";
|
|
8
|
+
import { parseISO as s } from "date-fns/parseISO";
|
|
4
9
|
//#region src/helpers/formatDate.ts
|
|
5
|
-
var
|
|
6
|
-
en:
|
|
7
|
-
es:
|
|
8
|
-
pt:
|
|
9
|
-
},
|
|
10
|
+
var c = {
|
|
11
|
+
en: i,
|
|
12
|
+
es: a,
|
|
13
|
+
pt: o
|
|
14
|
+
}, l = (e) => {
|
|
10
15
|
let t;
|
|
11
|
-
return t = typeof e == "number" ? e < 0xe8d4a51000 ? /* @__PURE__ */ new Date(e * 1e3) : new Date(e) : typeof e == "string" ?
|
|
16
|
+
return t = typeof e == "number" ? e < 0xe8d4a51000 ? /* @__PURE__ */ new Date(e * 1e3) : new Date(e) : typeof e == "string" ? s(e) : e, t;
|
|
12
17
|
};
|
|
13
|
-
function
|
|
18
|
+
function u(e, n = "dd MMMM, yyyy", r = "en") {
|
|
14
19
|
if (!e) return "";
|
|
15
|
-
let i =
|
|
16
|
-
return t(i, n, { locale:
|
|
20
|
+
let i = l(e);
|
|
21
|
+
return t(i, n, { locale: c[r] });
|
|
17
22
|
}
|
|
18
|
-
|
|
23
|
+
var d = (e) => {
|
|
24
|
+
let t = new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds());
|
|
25
|
+
return t.setFullYear(e.getUTCFullYear()), t;
|
|
26
|
+
};
|
|
27
|
+
function f(e, n = "dd MMMM, yyyy", r = "en") {
|
|
19
28
|
if (!e) return "";
|
|
20
|
-
let i =
|
|
21
|
-
return t(
|
|
29
|
+
let i = l(e);
|
|
30
|
+
return t(d(i), n, { locale: c[r] });
|
|
22
31
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
let i = f(e), a = Intl.DateTimeFormat().resolvedOptions().timeZone, o = u(i, a);
|
|
26
|
-
return t(o, n, { locale: d[r] });
|
|
32
|
+
function p(e, n = "dd MMMM, yyyy HH:mm", r = "en") {
|
|
33
|
+
return e ? t(l(e), n, { locale: c[r] }) : "";
|
|
27
34
|
}
|
|
28
|
-
function
|
|
29
|
-
let r =
|
|
35
|
+
function m(t, n) {
|
|
36
|
+
let r = l(t), i = l(n);
|
|
30
37
|
return e(i, r);
|
|
31
38
|
}
|
|
32
|
-
function
|
|
39
|
+
function h(e, t = "en", r) {
|
|
33
40
|
if (!e) return "";
|
|
34
|
-
let i =
|
|
41
|
+
let i = l(e);
|
|
35
42
|
return isNaN(i.getTime()) ? "" : n(i, {
|
|
36
43
|
...r,
|
|
37
|
-
locale:
|
|
44
|
+
locale: c[t]
|
|
38
45
|
});
|
|
39
46
|
}
|
|
40
|
-
function
|
|
47
|
+
function g(e) {
|
|
41
48
|
try {
|
|
42
49
|
return t(/* @__PURE__ */ new Date(), e), !0;
|
|
43
50
|
} catch {
|
|
44
51
|
return !1;
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
|
-
var
|
|
48
|
-
function b(e, n) {
|
|
49
|
-
if (typeof e != "string") return !1;
|
|
50
|
-
try {
|
|
51
|
-
let r = a(e, n, /* @__PURE__ */ new Date());
|
|
52
|
-
return i(r) ? t(r, n) === e : !1;
|
|
53
|
-
} catch {
|
|
54
|
-
return !1;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
54
|
+
var _ = (e) => Math.floor(r(l(e)) / 1e3).toString();
|
|
57
55
|
//#endregion
|
|
58
|
-
export {
|
|
56
|
+
export { u as formatDate, f as formatDateUTC, h as formatFromNow, p as formatUTCToLocal, m as getDurationMs, g as isValidFormat, l as parseDate, _ as toUnixSeconds };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { default as fetchManifest } from './fetchManifest';
|
|
2
2
|
import { default as generateFacade } from './generateFacade';
|
|
3
3
|
import { default as syntaxHighlight } from './syntaxHighlight';
|
|
4
|
+
export * from './cookies';
|
|
4
5
|
export * from './fetchManifest';
|
|
5
6
|
export * from './formatDate';
|
|
7
|
+
export * from './isDate';
|
|
6
8
|
export * from './generateFacade';
|
|
7
9
|
export * from './reducerOrigin';
|
|
8
10
|
export * from './ruleEvaluator';
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { filters as e } from "./twigWrapper/filters/filters.mjs";
|
|
2
|
-
import { processTwig as t } from "./twigWrapper/processTwig/processTwig.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
2
|
+
import { processTwig as t, processTwigParam as n, processTwigValue as r } from "./twigWrapper/processTwig/processTwig.mjs";
|
|
3
|
+
import { hasTemplateSyntax as i } from "./twigWrapper/tokens/hasTemplateSyntax.mjs";
|
|
4
|
+
import { hasValidToken as a } from "./twigWrapper/tokens/hasValidToken.mjs";
|
|
5
|
+
import { MAX_PARAM_PASSES as o, resolveStepParam as s } from "./twigWrapper/processTwig/resolveStepParam.mjs";
|
|
6
|
+
import { inspectTemplate as c } from "./twigWrapper/inspectTemplate.mjs";
|
|
7
|
+
import { templatePaths as l, templateRootNames as u } from "./twigWrapper/templateRoots.mjs";
|
|
8
|
+
import d from "./fetchManifest.mjs";
|
|
9
|
+
import f from "./generateFacade.mjs";
|
|
10
|
+
import p from "./syntaxHighlight.mjs";
|
|
11
|
+
import { cookieFromHeader as m, documentCookies as h } from "./cookies.mjs";
|
|
12
|
+
import { formatDate as g, formatDateUTC as _, formatFromNow as v, formatUTCToLocal as y, getDurationMs as b, isValidFormat as x, parseDate as S, toUnixSeconds as C } from "./formatDate.mjs";
|
|
13
|
+
import { isDate as w } from "./isDate.mjs";
|
|
14
|
+
import { isUserEdit as T } from "./reducerOrigin.mjs";
|
|
15
|
+
import { evaluateRuleGroup as E } from "./ruleEvaluator.mjs";
|
|
16
|
+
import { ParamsFromURL as D, delay as O, emptyObject as k, getDisplayName as A, getKeyDecoded as j, getPathsFromObeject as M, hexToRGB as N, isInViewport as P, makeId as F } from "./utils.mjs";
|
|
17
|
+
import { disableReactDevTools as I } from "./security.mjs";
|
|
18
|
+
import { createStripTypenameLink as L, stripTypenameDeep as R } from "./stripTypename.mjs";
|
|
19
|
+
export { o as MAX_PARAM_PASSES, D as ParamsFromURL, m as cookieFromHeader, L as createStripTypenameLink, O as delay, I as disableReactDevTools, h as documentCookies, k as emptyObject, E as evaluateRuleGroup, d as fetchManifest, e as filters, g as formatDate, _ as formatDateUTC, v as formatFromNow, y as formatUTCToLocal, f as generateFacade, A as getDisplayName, b as getDurationMs, j as getKeyDecoded, M as getPathsFromObeject, i as hasTemplateSyntax, a as hasValidToken, N as hexToRGB, c as inspectTemplate, w as isDate, P as isInViewport, T as isUserEdit, x as isValidFormat, F as makeId, S as parseDate, t as processTwig, n as processTwigParam, r as processTwigValue, s as resolveStepParam, R as stripTypenameDeep, p as syntaxHighlight, l as templatePaths, u as templateRootNames, C as toUnixSeconds };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A module of its own because `parse` is the heaviest thing in date-fns — it compiles every token parser the format
|
|
3
|
+
* language has, about 100 MB of memory on the way in — and nothing that formats a date should pay for it. Imported from
|
|
4
|
+
* `formatDate`, it was paid by every page server at start, for a function no renderer calls.
|
|
5
|
+
*/
|
|
6
|
+
/** Strictly validates whether a string matches a given date-fns format. */
|
|
7
|
+
export declare function isDate(value: string, formatStr: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { format as e } from "date-fns/format";
|
|
2
|
+
import { isValid as t } from "date-fns/isValid";
|
|
3
|
+
import { parse as n } from "date-fns/parse";
|
|
4
|
+
//#region src/helpers/isDate.ts
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
if (typeof r != "string") return !1;
|
|
7
|
+
try {
|
|
8
|
+
let a = n(r, i, /* @__PURE__ */ new Date());
|
|
9
|
+
return t(a) ? e(a, i) === r : !1;
|
|
10
|
+
} catch {
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { r as isDate };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard shortcuts, as a space writes them: `'f'`, `'shift+f'`, `'mod+k'`, `'escape'`, several at once with commas
|
|
3
|
+
* (`'plus, ='`).
|
|
4
|
+
*
|
|
5
|
+
* Both halves of matching live here — reading what an author wrote and reading what a key press was — so they meet
|
|
6
|
+
* in one canonical form: modifiers in a fixed order, then the key, lower case (`ctrl+shift+f`). Authoring reads the
|
|
7
|
+
* first half to refuse a shortcut that could never fire; the element listening reads both.
|
|
8
|
+
*/
|
|
9
|
+
/** The trigger a shortcut starts: fired once per key press, with every shortcut it matched. */
|
|
10
|
+
export declare const KEY_TRIGGER = "onKey";
|
|
11
|
+
export type KeyTriggerPayload = {
|
|
12
|
+
/** The key pressed, canonical — `shift+f`. */
|
|
13
|
+
key: string;
|
|
14
|
+
/** Each `keys` param, exactly as written, that the press matched: the flows that run are the ones written so. */
|
|
15
|
+
shortcuts: string[];
|
|
16
|
+
};
|
|
17
|
+
export type ParsedKeys = {
|
|
18
|
+
/** Each shortcut, canonical: `ctrl+alt+shift+meta+key`, with only the modifiers it uses. */
|
|
19
|
+
combos: string[];
|
|
20
|
+
/** Each part that is not a shortcut, with why — empty when all of it is. */
|
|
21
|
+
problems: string[];
|
|
22
|
+
};
|
|
23
|
+
/** Every shortcut in what an author wrote, canonical, and what in it is not one. */
|
|
24
|
+
export declare const parseKeys: (spec: string, isMac?: boolean) => ParsedKeys;
|
|
25
|
+
export type KeyPress = Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'altKey' | 'shiftKey' | 'metaKey'>;
|
|
26
|
+
/**
|
|
27
|
+
* A key press, in the form {@link parseKeys} writes.
|
|
28
|
+
*
|
|
29
|
+
* Two keyboard facts decide it. Shift is part of a LETTER's shortcut (`shift+f`), but a symbol is typed with whatever
|
|
30
|
+
* it takes — `+` is Shift+= on one keyboard and a key of its own on another — so for a symbol Shift is not counted.
|
|
31
|
+
* And with Alt, Ctrl or ⌘ held, `key` can be another character altogether (Option+F is `ƒ` on a Mac): the physical
|
|
32
|
+
* letter or digit is read from `code` instead.
|
|
33
|
+
*/
|
|
34
|
+
export declare const keyPressCombo: (press: KeyPress) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Whether a press, made in a text field, is the field's own editing — so a shortcut must not take it.
|
|
37
|
+
*
|
|
38
|
+
* With ⌘, Ctrl or Alt held a press in a field is otherwise a shortcut's, which is what lets `mod+k` open a palette
|
|
39
|
+
* from a search box. But `mod+a` in a title field is "select this text", not "select everything on the board", and
|
|
40
|
+
* `alt+backspace` deletes a word: a shortcut that took those would break typing wherever the page has one.
|
|
41
|
+
*/
|
|
42
|
+
export declare const isFieldEditing: (combo: string) => boolean;
|