@teleporthq/teleport-shared 0.43.46 → 0.43.47
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/__tests__/utils/js-identifiers.ts +147 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/utils/js-identifiers.d.ts +89 -0
- package/dist/cjs/utils/js-identifiers.d.ts.map +1 -0
- package/dist/cjs/utils/js-identifiers.js +208 -0
- package/dist/cjs/utils/js-identifiers.js.map +1 -0
- package/dist/cjs/utils/route-paths.d.ts +45 -0
- package/dist/cjs/utils/route-paths.d.ts.map +1 -0
- package/dist/cjs/utils/route-paths.js +86 -0
- package/dist/cjs/utils/route-paths.js.map +1 -0
- package/dist/cjs/utils/string-utils.d.ts +18 -0
- package/dist/cjs/utils/string-utils.d.ts.map +1 -1
- package/dist/cjs/utils/string-utils.js +24 -2
- package/dist/cjs/utils/string-utils.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/utils/js-identifiers.d.ts +89 -0
- package/dist/esm/utils/js-identifiers.d.ts.map +1 -0
- package/dist/esm/utils/js-identifiers.js +200 -0
- package/dist/esm/utils/js-identifiers.js.map +1 -0
- package/dist/esm/utils/route-paths.d.ts +45 -0
- package/dist/esm/utils/route-paths.d.ts.map +1 -0
- package/dist/esm/utils/route-paths.js +81 -0
- package/dist/esm/utils/route-paths.js.map +1 -0
- package/dist/esm/utils/string-utils.d.ts +18 -0
- package/dist/esm/utils/string-utils.d.ts.map +1 -1
- package/dist/esm/utils/string-utils.js +22 -1
- package/dist/esm/utils/string-utils.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +3 -1
- package/src/utils/js-identifiers.ts +214 -0
- package/src/utils/route-paths.ts +87 -0
- package/src/utils/string-utils.ts +24 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* JavaScript identifier safety for names that originate in the UIDL.
|
|
4
|
+
*
|
|
5
|
+
* A UIDL state / prop / global-state name is DATA. It is routinely derived from
|
|
6
|
+
* a database column or a form field, so it can legally be any string — a WoW
|
|
7
|
+
* character sheet really does have a column called `class`. The generators, on
|
|
8
|
+
* the other hand, turn those names into JavaScript BINDINGS
|
|
9
|
+
* (`const [class, setClass] = useState("")`), and `class` is a reserved word:
|
|
10
|
+
* the emitted page does not parse, prettier throws
|
|
11
|
+
* `SyntaxError: Unexpected token, expected "{"`, and the whole project build
|
|
12
|
+
* dies before a single file is written.
|
|
13
|
+
*
|
|
14
|
+
* This module is the single place that maps "a name from the UIDL" to "a name
|
|
15
|
+
* that is legal in identifier position".
|
|
16
|
+
*
|
|
17
|
+
* ## What is deliberately NOT renamed
|
|
18
|
+
*
|
|
19
|
+
* Only IDENTIFIER positions are sanitised. Everywhere a name is a STRING — the
|
|
20
|
+
* `stateSetters` / `stateTypes` / `__stateValues` map keys the workflow runtime
|
|
21
|
+
* looks up by `config.property`, an object-literal key, a `props.<name>` member
|
|
22
|
+
* access — the original name is kept verbatim. Renaming those would silently
|
|
23
|
+
* break every workflow binding written against the original name (the runtime
|
|
24
|
+
* would log `no setter for "class"` and skip the update), which is a far worse
|
|
25
|
+
* failure than the build error this module exists to prevent.
|
|
26
|
+
*
|
|
27
|
+
* ## Why a trailing underscore is collision-free
|
|
28
|
+
*
|
|
29
|
+
* Every state / prop name reaches the generators through
|
|
30
|
+
* `StringUtils.createStateOrPropStoringValue`, i.e. `dashCaseToCamelCase`,
|
|
31
|
+
* whose `/[-_]+(.)?/g` replacement removes EVERY underscore. So a normalised
|
|
32
|
+
* name can never itself end in `_`, and `class` -> `class_` cannot collide with
|
|
33
|
+
* a sibling name.
|
|
34
|
+
*/
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createSafeJSIdentifierPath = exports.createSafeJSIdentifier = exports.isValidPropertyKeyName = exports.isValidJSIdentifierName = exports.isReservedJSIdentifier = exports.FALLBACK_JS_IDENTIFIER = exports.RESERVED_JS_IDENTIFIERS = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Words that may never be used as a binding name in the code we emit.
|
|
39
|
+
*
|
|
40
|
+
* Generated components are ES modules and therefore always strict mode, so the
|
|
41
|
+
* strict-mode-only reserved words are as fatal as the unconditional ones.
|
|
42
|
+
*
|
|
43
|
+
* `undefined` is not a reserved word, but binding it shadows the value the
|
|
44
|
+
* generators emit for "no value" (`t.identifier('undefined')`) throughout the
|
|
45
|
+
* output, so it is treated as reserved here as well.
|
|
46
|
+
*/
|
|
47
|
+
exports.RESERVED_JS_IDENTIFIERS = new Set([
|
|
48
|
+
// Reserved in every context.
|
|
49
|
+
'break',
|
|
50
|
+
'case',
|
|
51
|
+
'catch',
|
|
52
|
+
'class',
|
|
53
|
+
'const',
|
|
54
|
+
'continue',
|
|
55
|
+
'debugger',
|
|
56
|
+
'default',
|
|
57
|
+
'delete',
|
|
58
|
+
'do',
|
|
59
|
+
'else',
|
|
60
|
+
'enum',
|
|
61
|
+
'export',
|
|
62
|
+
'extends',
|
|
63
|
+
'false',
|
|
64
|
+
'finally',
|
|
65
|
+
'for',
|
|
66
|
+
'function',
|
|
67
|
+
'if',
|
|
68
|
+
'import',
|
|
69
|
+
'in',
|
|
70
|
+
'instanceof',
|
|
71
|
+
'new',
|
|
72
|
+
'null',
|
|
73
|
+
'return',
|
|
74
|
+
'super',
|
|
75
|
+
'switch',
|
|
76
|
+
'this',
|
|
77
|
+
'throw',
|
|
78
|
+
'true',
|
|
79
|
+
'try',
|
|
80
|
+
'typeof',
|
|
81
|
+
'var',
|
|
82
|
+
'void',
|
|
83
|
+
'while',
|
|
84
|
+
'with',
|
|
85
|
+
// Reserved in strict mode / modules — which is all generated output.
|
|
86
|
+
'arguments',
|
|
87
|
+
'await',
|
|
88
|
+
'eval',
|
|
89
|
+
'implements',
|
|
90
|
+
'interface',
|
|
91
|
+
'let',
|
|
92
|
+
'package',
|
|
93
|
+
'private',
|
|
94
|
+
'protected',
|
|
95
|
+
'public',
|
|
96
|
+
'static',
|
|
97
|
+
'yield',
|
|
98
|
+
// Not reserved, but binding it breaks the generators' own emissions.
|
|
99
|
+
'undefined',
|
|
100
|
+
]);
|
|
101
|
+
/** Matches a complete, syntactically valid ECMAScript identifier (ASCII subset). */
|
|
102
|
+
var VALID_IDENTIFIER_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
103
|
+
/** Matches the leading identifier of an id such as `class?.['spec']` or `fields.name`. */
|
|
104
|
+
var LEADING_IDENTIFIER_RE = /^[A-Za-z_$][A-Za-z0-9_$]*/;
|
|
105
|
+
/** Every character that is illegal anywhere inside an identifier. */
|
|
106
|
+
var ILLEGAL_IDENTIFIER_CHARS_RE = /[^A-Za-z0-9_$]/g;
|
|
107
|
+
/** Used when a name sanitises down to nothing at all (e.g. `"***"`). */
|
|
108
|
+
exports.FALLBACK_JS_IDENTIFIER = '_value';
|
|
109
|
+
/** True when `name` is a reserved word that cannot be used as a binding. */
|
|
110
|
+
var isReservedJSIdentifier = function (name) {
|
|
111
|
+
return typeof name === 'string' && exports.RESERVED_JS_IDENTIFIERS.has(name);
|
|
112
|
+
};
|
|
113
|
+
exports.isReservedJSIdentifier = isReservedJSIdentifier;
|
|
114
|
+
/**
|
|
115
|
+
* True when `name` can be emitted verbatim in identifier position — i.e. it is
|
|
116
|
+
* a syntactically valid identifier AND not a reserved word.
|
|
117
|
+
*/
|
|
118
|
+
var isValidJSIdentifierName = function (name) {
|
|
119
|
+
return typeof name === 'string' && VALID_IDENTIFIER_RE.test(name) && !exports.RESERVED_JS_IDENTIFIERS.has(name);
|
|
120
|
+
};
|
|
121
|
+
exports.isValidJSIdentifierName = isValidJSIdentifierName;
|
|
122
|
+
/**
|
|
123
|
+
* True when `name` can be an UNQUOTED object-literal key or a member access
|
|
124
|
+
* after a dot. Reserved words qualify — `{ class: x }` and `props.class` are
|
|
125
|
+
* both legal — so this is deliberately laxer than
|
|
126
|
+
* {@link isValidJSIdentifierName}; only the identifier SYNTAX matters here.
|
|
127
|
+
*/
|
|
128
|
+
var isValidPropertyKeyName = function (name) {
|
|
129
|
+
return typeof name === 'string' && VALID_IDENTIFIER_RE.test(name);
|
|
130
|
+
};
|
|
131
|
+
exports.isValidPropertyKeyName = isValidPropertyKeyName;
|
|
132
|
+
/**
|
|
133
|
+
* Map any UIDL-supplied name onto a name that is legal in binding position.
|
|
134
|
+
*
|
|
135
|
+
* Valid, non-reserved names are returned UNCHANGED, so this is a no-op for
|
|
136
|
+
* every name the generators have ever produced — the emitted output only
|
|
137
|
+
* differs for names that would not have compiled at all.
|
|
138
|
+
*
|
|
139
|
+
* Not injective in the general case (`a-b` and `a_b` both sanitise to `a_b`),
|
|
140
|
+
* which is safe here because state / prop names are normalised through
|
|
141
|
+
* `createStateOrPropStoringValue` first and therefore contain neither
|
|
142
|
+
* character by the time a generator sees them.
|
|
143
|
+
*/
|
|
144
|
+
var createSafeJSIdentifier = function (name, fallback) {
|
|
145
|
+
if (fallback === void 0) { fallback = exports.FALLBACK_JS_IDENTIFIER; }
|
|
146
|
+
if (typeof name !== 'string' || name === '') {
|
|
147
|
+
return fallback;
|
|
148
|
+
}
|
|
149
|
+
if ((0, exports.isValidJSIdentifierName)(name)) {
|
|
150
|
+
return name;
|
|
151
|
+
}
|
|
152
|
+
var safe = name.replace(ILLEGAL_IDENTIFIER_CHARS_RE, '_');
|
|
153
|
+
if (/^[0-9]/.test(safe)) {
|
|
154
|
+
safe = "_".concat(safe);
|
|
155
|
+
}
|
|
156
|
+
// `"***"` collapses to `"___"`, which is a legal identifier, so the only way
|
|
157
|
+
// to reach an empty string here is an empty input — already handled above.
|
|
158
|
+
if (safe === '') {
|
|
159
|
+
return fallback;
|
|
160
|
+
}
|
|
161
|
+
// Re-check AFTER the character pass: `"class"` survives it untouched, and
|
|
162
|
+
// `"my class"` becomes `"my_class"` which is no longer reserved.
|
|
163
|
+
return exports.RESERVED_JS_IDENTIFIERS.has(safe) ? "".concat(safe, "_") : safe;
|
|
164
|
+
};
|
|
165
|
+
exports.createSafeJSIdentifier = createSafeJSIdentifier;
|
|
166
|
+
/**
|
|
167
|
+
* A property path is all that may follow the binding: optional chaining,
|
|
168
|
+
* dotted access, or a bracket lookup. Anything else (a space, an operator, a
|
|
169
|
+
* call) means the string is a hand-written EXPRESSION rather than a reference,
|
|
170
|
+
* and rewriting its first word would corrupt it — `typeof x === 'string'` must
|
|
171
|
+
* never become `typeof_ x === 'string'`.
|
|
172
|
+
*/
|
|
173
|
+
var PROPERTY_PATH_TAIL_RE = /^(\?\.|\.|\[)/;
|
|
174
|
+
/**
|
|
175
|
+
* Sanitise ONLY the leading identifier of an id that may already carry a
|
|
176
|
+
* property path, leaving the path untouched:
|
|
177
|
+
*
|
|
178
|
+
* `class` -> `class_`
|
|
179
|
+
* `class?.['spec']` -> `class_?.['spec']`
|
|
180
|
+
* `fields.name` -> `fields.name` (already legal — unchanged)
|
|
181
|
+
* `typeof x === 'y'` -> `typeof x === 'y'` (an expression — untouched)
|
|
182
|
+
*
|
|
183
|
+
* `UIDLUtils.generateIdWithRefPath` produces exactly the first three shapes,
|
|
184
|
+
* and the JSX generators hand the whole string to `t.identifier(...)` and rely
|
|
185
|
+
* on babel printing it verbatim. Only the head is a binding; the rest is member
|
|
186
|
+
* access against real data keys and must keep its original spelling.
|
|
187
|
+
*/
|
|
188
|
+
var createSafeJSIdentifierPath = function (idWithPath) {
|
|
189
|
+
if (typeof idWithPath !== 'string' || idWithPath === '') {
|
|
190
|
+
return idWithPath;
|
|
191
|
+
}
|
|
192
|
+
var match = LEADING_IDENTIFIER_RE.exec(idWithPath);
|
|
193
|
+
if (!match) {
|
|
194
|
+
// Does not start with an identifier at all (e.g. a numeric or empty head).
|
|
195
|
+
// There is nothing safe to rewrite, so leave it for the caller's own
|
|
196
|
+
// validation rather than inventing a binding.
|
|
197
|
+
return idWithPath;
|
|
198
|
+
}
|
|
199
|
+
var head = match[0];
|
|
200
|
+
var tail = idWithPath.slice(head.length);
|
|
201
|
+
if (tail !== '' && !PROPERTY_PATH_TAIL_RE.test(tail)) {
|
|
202
|
+
return idWithPath;
|
|
203
|
+
}
|
|
204
|
+
var safeHead = (0, exports.createSafeJSIdentifier)(head);
|
|
205
|
+
return safeHead === head ? idWithPath : "".concat(safeHead).concat(tail);
|
|
206
|
+
};
|
|
207
|
+
exports.createSafeJSIdentifierPath = createSafeJSIdentifierPath;
|
|
208
|
+
//# sourceMappingURL=js-identifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-identifiers.js","sourceRoot":"","sources":["../../../src/utils/js-identifiers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAEH;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAAwB,IAAI,GAAG,CAAS;IAC1E,6BAA6B;IAC7B,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,qEAAqE;IACrE,WAAW;IACX,OAAO;IACP,MAAM;IACN,YAAY;IACZ,WAAW;IACX,KAAK;IACL,SAA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CAAC,CAAC,UAAG,QAAQ,SAAG,IAAI,CAAE,CAAA;AAC9D,CAAC,CAAA;AArBY,QAAA,0BAA0B,8BAqBtC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading Next.js dynamic route templates.
|
|
3
|
+
*
|
|
4
|
+
* A details page's route is a TEMPLATE, not a URL: `/event-details/[id]`. Two
|
|
5
|
+
* different consumers have to understand that, and both got it wrong in
|
|
6
|
+
* different ways — the SEO head plugin emitted the template verbatim into
|
|
7
|
+
* `<link rel="canonical">`, `og:url` and the sitemap, and the navlink resolver
|
|
8
|
+
* handed out the bare prefix (`/event-details`) as if it were a real route.
|
|
9
|
+
* Both produce a URL that 404s.
|
|
10
|
+
*
|
|
11
|
+
* Lives in teleport-shared because the two callers sit in packages that do not
|
|
12
|
+
* (and should not) depend on each other.
|
|
13
|
+
*
|
|
14
|
+
* Pure; never throws.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* True when `path` contains at least one Next.js dynamic segment (`/[id]`).
|
|
18
|
+
*
|
|
19
|
+
* The string form of `isDynamicRoute`, for callers that hold a URL or a
|
|
20
|
+
* `navLink` rather than a component's `outputOptions`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const pathHasDynamicSegment: (path: string) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Split a URL or path into the literal text around its parameters, plus the
|
|
25
|
+
* parameter names in order — so a caller can rebuild it as a template literal.
|
|
26
|
+
*
|
|
27
|
+
* Recognises BOTH spellings a canonical/`navLink` value can arrive in:
|
|
28
|
+
* - `${id}` — the template-literal form;
|
|
29
|
+
* - `[id]` — the Next.js route form, which is what a details page's
|
|
30
|
+
* `navLink` actually carries (`/event-details/[id]`).
|
|
31
|
+
*
|
|
32
|
+
* Only the `${...}` form was understood before, so every details page shipped
|
|
33
|
+
* its canonical URL, `og:url` and sitemap entry containing the literal text
|
|
34
|
+
* `[id]` — a URL that 404s for every crawler and every shared link.
|
|
35
|
+
*
|
|
36
|
+
* `staticParts` always has exactly `paramNames.length + 1` entries, so
|
|
37
|
+
* `staticParts[i]` precedes `paramNames[i]`. With no parameters the result is
|
|
38
|
+
* `{ staticParts: [str], paramNames: [] }`, which callers use to keep emitting
|
|
39
|
+
* a plain string attribute.
|
|
40
|
+
*/
|
|
41
|
+
export declare const parseDynamicPathSegments: (str: string) => {
|
|
42
|
+
staticParts: string[];
|
|
43
|
+
paramNames: string[];
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=route-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-paths.d.ts","sourceRoot":"","sources":["../../../src/utils/route-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAuBH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,KAAG,OACK,CAAA;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,QAC9B,MAAM;iBACK,MAAM,EAAE;gBAAc,MAAM,EAAE;CAoB/C,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Reading Next.js dynamic route templates.
|
|
4
|
+
*
|
|
5
|
+
* A details page's route is a TEMPLATE, not a URL: `/event-details/[id]`. Two
|
|
6
|
+
* different consumers have to understand that, and both got it wrong in
|
|
7
|
+
* different ways — the SEO head plugin emitted the template verbatim into
|
|
8
|
+
* `<link rel="canonical">`, `og:url` and the sitemap, and the navlink resolver
|
|
9
|
+
* handed out the bare prefix (`/event-details`) as if it were a real route.
|
|
10
|
+
* Both produce a URL that 404s.
|
|
11
|
+
*
|
|
12
|
+
* Lives in teleport-shared because the two callers sit in packages that do not
|
|
13
|
+
* (and should not) depend on each other.
|
|
14
|
+
*
|
|
15
|
+
* Pure; never throws.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.parseDynamicPathSegments = exports.pathHasDynamicSegment = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* A Next.js dynamic path segment — `/[id]`, `/[slug]` — occupying a WHOLE
|
|
21
|
+
* segment.
|
|
22
|
+
*
|
|
23
|
+
* Anchored on BOTH sides so a stray bracket is never mistaken for a route
|
|
24
|
+
* param: on the left it must open a segment (start of string or `/`), and on
|
|
25
|
+
* the right it must close one. "Closes a segment" is deliberately wider than
|
|
26
|
+
* `/` or end-of-string, because a URL is not always the whole string — the same
|
|
27
|
+
* template appears inside a serialized JSON-LD document, where the path ends at
|
|
28
|
+
* the closing quote. Anything that cannot itself be part of a path segment ends
|
|
29
|
+
* it.
|
|
30
|
+
*
|
|
31
|
+
* The name must be a plain JS identifier, which excludes Next's catch-all forms
|
|
32
|
+
* (`[...slug]`, `[[...slug]]`): their value is an ARRAY and cannot be
|
|
33
|
+
* interpolated into a URL by simple substitution.
|
|
34
|
+
*/
|
|
35
|
+
var DYNAMIC_PATH_SEGMENT_SOURCE = '(^|\\/)\\[([A-Za-z_$][A-Za-z0-9_$]*)\\](?=$|[\\/"\'\\s,)}])';
|
|
36
|
+
/** `${name}` — the template-literal spelling some upstream writers emit. */
|
|
37
|
+
var TEMPLATE_EXPRESSION_SOURCE = '\\$\\{([^}]+)\\}';
|
|
38
|
+
/**
|
|
39
|
+
* True when `path` contains at least one Next.js dynamic segment (`/[id]`).
|
|
40
|
+
*
|
|
41
|
+
* The string form of `isDynamicRoute`, for callers that hold a URL or a
|
|
42
|
+
* `navLink` rather than a component's `outputOptions`.
|
|
43
|
+
*/
|
|
44
|
+
var pathHasDynamicSegment = function (path) {
|
|
45
|
+
return new RegExp(DYNAMIC_PATH_SEGMENT_SOURCE).test(path || '');
|
|
46
|
+
};
|
|
47
|
+
exports.pathHasDynamicSegment = pathHasDynamicSegment;
|
|
48
|
+
/**
|
|
49
|
+
* Split a URL or path into the literal text around its parameters, plus the
|
|
50
|
+
* parameter names in order — so a caller can rebuild it as a template literal.
|
|
51
|
+
*
|
|
52
|
+
* Recognises BOTH spellings a canonical/`navLink` value can arrive in:
|
|
53
|
+
* - `${id}` — the template-literal form;
|
|
54
|
+
* - `[id]` — the Next.js route form, which is what a details page's
|
|
55
|
+
* `navLink` actually carries (`/event-details/[id]`).
|
|
56
|
+
*
|
|
57
|
+
* Only the `${...}` form was understood before, so every details page shipped
|
|
58
|
+
* its canonical URL, `og:url` and sitemap entry containing the literal text
|
|
59
|
+
* `[id]` — a URL that 404s for every crawler and every shared link.
|
|
60
|
+
*
|
|
61
|
+
* `staticParts` always has exactly `paramNames.length + 1` entries, so
|
|
62
|
+
* `staticParts[i]` precedes `paramNames[i]`. With no parameters the result is
|
|
63
|
+
* `{ staticParts: [str], paramNames: [] }`, which callers use to keep emitting
|
|
64
|
+
* a plain string attribute.
|
|
65
|
+
*/
|
|
66
|
+
var parseDynamicPathSegments = function (str) {
|
|
67
|
+
var regex = new RegExp("".concat(TEMPLATE_EXPRESSION_SOURCE, "|").concat(DYNAMIC_PATH_SEGMENT_SOURCE), 'g');
|
|
68
|
+
var staticParts = [];
|
|
69
|
+
var paramNames = [];
|
|
70
|
+
var lastIndex = 0;
|
|
71
|
+
var match = regex.exec(str);
|
|
72
|
+
while (match !== null) {
|
|
73
|
+
var isBracketForm = match[3] !== undefined;
|
|
74
|
+
// For `/[id]` the matched text starts with the separator, which belongs to
|
|
75
|
+
// the static text BEFORE the parameter — not to the parameter itself.
|
|
76
|
+
var separator = isBracketForm ? match[2] : '';
|
|
77
|
+
staticParts.push(str.slice(lastIndex, match.index) + separator);
|
|
78
|
+
paramNames.push(isBracketForm ? match[3] : match[1]);
|
|
79
|
+
lastIndex = regex.lastIndex;
|
|
80
|
+
match = regex.exec(str);
|
|
81
|
+
}
|
|
82
|
+
staticParts.push(str.slice(lastIndex));
|
|
83
|
+
return { staticParts: staticParts, paramNames: paramNames };
|
|
84
|
+
};
|
|
85
|
+
exports.parseDynamicPathSegments = parseDynamicPathSegments;
|
|
86
|
+
//# sour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AK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACpD,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;QAC3B,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACxB;IACD,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;IAEtC,OAAO,EAAE,WAAW,aAAA,EAAE,UAAU,YAAA,EAAE,CAAA;AACpC,CAAC,CAAA;AAtBY,QAAA,wBAAwB,4BAsBpC"}
|
|
@@ -6,7 +6,25 @@ export declare const dashCaseToUpperCamelCase: (str: string) => string;
|
|
|
6
6
|
export declare const removeIllegalCharacters: (str: string) => string;
|
|
7
7
|
export declare const slugify: (str: string) => string;
|
|
8
8
|
export declare const createStateOrPropStoringValue: (value: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* The single funnel for state SETTER names. `set` + <Name> can never be a
|
|
11
|
+
* reserved word, but a name carrying characters that survive the camel-casing
|
|
12
|
+
* (e.g. a dot) would still produce something that is not an identifier, so the
|
|
13
|
+
* result is routed through the shared sanitiser. This is a no-op for every
|
|
14
|
+
* name that already produced valid output.
|
|
15
|
+
*/
|
|
9
16
|
export declare const createStateStoringFunction: (value: string) => string;
|
|
17
|
+
/**
|
|
18
|
+
* The setter name a GLOBAL state is published under on the `useGlobalState()`
|
|
19
|
+
* context. Unlike component state this is NOT camel-cased — the provider, the
|
|
20
|
+
* consumer destructuring and the workflow setter map must all agree on the
|
|
21
|
+
* exact same context key, so the declared name is only capitalised.
|
|
22
|
+
*
|
|
23
|
+
* Returns the RAW context key. Callers that need a local binding must run it
|
|
24
|
+
* through `JSIdentifiers.createSafeJSIdentifier` themselves, so the key and the
|
|
25
|
+
* binding stay independently correct.
|
|
26
|
+
*/
|
|
27
|
+
export declare const createGlobalStateSetterName: (name: string) => string;
|
|
10
28
|
export declare const addSpacesToEachLine: (spaces: string, str: string) => string;
|
|
11
29
|
export declare const removeLastEmptyLine: (str: string) => string;
|
|
12
30
|
export declare const encode: (str: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/string-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/string-utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MACgC,CAAA;AAClF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MACqB,CAAA;AAEvE,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAA6C,CAAA;AACtF,eAAO,MAAM,QAAQ,QAAS,MAAM,KAAG,MAA6C,CAAA;AAEpF,eAAO,MAAM,wBAAwB,QAAS,MAAM,WAAyC,CAAA;AAE7F,eAAO,MAAM,uBAAuB,QAAS,MAAM,WAWlD,CAAA;AAED,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAarC,CAAA;AAED,eAAO,MAAM,6BAA6B,UAAW,MAAM,WAAyC,CAAA;AAEpG;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,UAAW,MAAM,WACqB,CAAA;AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,SAAU,MAAM,KAAG,MACW,CAAA;AAEtE,eAAO,MAAM,mBAAmB,WAAY,MAAM,OAAO,MAAM,WAK9D,CAAA;AAED,eAAO,MAAM,mBAAmB,QAAS,MAAM,WAE9C,CAAA;AAYD,eAAO,MAAM,MAAM,QAAS,MAAM,WAQjC,CAAA;AAED,eAAO,MAAM,oBAAoB,cAAmD,CAAA;AAEpF,eAAO,MAAM,uBAAuB,SAAU,MAAM,KAAG,MAEtD,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateCSSVariableName = exports.generateRandomString = exports.encode = exports.removeLastEmptyLine = exports.addSpacesToEachLine = exports.createStateStoringFunction = exports.createStateOrPropStoringValue = exports.slugify = exports.removeIllegalCharacters = exports.dashCaseToUpperCamelCase = exports.camelize = exports.capitalize = exports.dashCaseToCamelCase = exports.camelCaseToDashCase = void 0;
|
|
3
|
+
exports.generateCSSVariableName = exports.generateRandomString = exports.encode = exports.removeLastEmptyLine = exports.addSpacesToEachLine = exports.createGlobalStateSetterName = exports.createStateStoringFunction = exports.createStateOrPropStoringValue = exports.slugify = exports.removeIllegalCharacters = exports.dashCaseToUpperCamelCase = exports.camelize = exports.capitalize = exports.dashCaseToCamelCase = exports.camelCaseToDashCase = void 0;
|
|
4
|
+
var js_identifiers_1 = require("./js-identifiers");
|
|
4
5
|
var camelCaseToDashCase = function (str) {
|
|
5
6
|
return str.replace(/([a-z])(?=[A-Z])|([A-Z0-9])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase();
|
|
6
7
|
};
|
|
@@ -43,10 +44,31 @@ var slugify = function (str) {
|
|
|
43
44
|
exports.slugify = slugify;
|
|
44
45
|
var createStateOrPropStoringValue = function (value) { return (0, exports.camelize)((0, exports.dashCaseToCamelCase)(value)); };
|
|
45
46
|
exports.createStateOrPropStoringValue = createStateOrPropStoringValue;
|
|
47
|
+
/**
|
|
48
|
+
* The single funnel for state SETTER names. `set` + <Name> can never be a
|
|
49
|
+
* reserved word, but a name carrying characters that survive the camel-casing
|
|
50
|
+
* (e.g. a dot) would still produce something that is not an identifier, so the
|
|
51
|
+
* result is routed through the shared sanitiser. This is a no-op for every
|
|
52
|
+
* name that already produced valid output.
|
|
53
|
+
*/
|
|
46
54
|
var createStateStoringFunction = function (value) {
|
|
47
|
-
return "set".concat((0, exports.capitalize)((0, exports.dashCaseToUpperCamelCase)(value)));
|
|
55
|
+
return (0, js_identifiers_1.createSafeJSIdentifier)("set".concat((0, exports.capitalize)((0, exports.dashCaseToUpperCamelCase)(value))));
|
|
48
56
|
};
|
|
49
57
|
exports.createStateStoringFunction = createStateStoringFunction;
|
|
58
|
+
/**
|
|
59
|
+
* The setter name a GLOBAL state is published under on the `useGlobalState()`
|
|
60
|
+
* context. Unlike component state this is NOT camel-cased — the provider, the
|
|
61
|
+
* consumer destructuring and the workflow setter map must all agree on the
|
|
62
|
+
* exact same context key, so the declared name is only capitalised.
|
|
63
|
+
*
|
|
64
|
+
* Returns the RAW context key. Callers that need a local binding must run it
|
|
65
|
+
* through `JSIdentifiers.createSafeJSIdentifier` themselves, so the key and the
|
|
66
|
+
* binding stay independently correct.
|
|
67
|
+
*/
|
|
68
|
+
var createGlobalStateSetterName = function (name) {
|
|
69
|
+
return "set".concat((name || '').charAt(0).toUpperCase()).concat((name || '').slice(1));
|
|
70
|
+
};
|
|
71
|
+
exports.createGlobalStateSetterName = createGlobalStateSetterName;
|
|
50
72
|
var addSpacesToEachLine = function (spaces, str) {
|
|
51
73
|
// indent the first line
|
|
52
74
|
var respaced = spaces + str;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../../src/utils/string-utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../../src/utils/string-utils.ts"],"names":[],"mappings":";;;AAAA,mDAAyD;AAElD,IAAM,mBAAmB,GAAG,UAAC,GAAW;IAC7C,OAAA,GAAG,CAAC,OAAO,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE;AAAhF,CAAgF,CAAA;AADrE,QAAA,mBAAmB,uBACkD;AAC3E,IAAM,mBAAmB,GAAG,UAAC,GAAW;IAC7C,OAAA,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,UAAC,CAAC,EAAE,GAAG,IAAK,OAAA,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAA9B,CAA8B,CAAC;AAArE,CAAqE,CAAA;AAD1D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
|
|
3
3
|
import * as UIDLUtils from './utils/uidl-utils';
|
|
4
4
|
import * as GenericUtils from './utils/generic';
|
|
5
|
-
|
|
5
|
+
import * as JSIdentifiers from './utils/js-identifiers';
|
|
6
|
+
import * as RoutePaths from './utils/route-paths';
|
|
7
|
+
export { Constants, StringUtils, UIDLUtils, GenericUtils, JSIdentifiers, RoutePaths };
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,5 +2,7 @@ import * as Constants from './constants';
|
|
|
2
2
|
import * as StringUtils from './utils/string-utils';
|
|
3
3
|
import * as UIDLUtils from './utils/uidl-utils';
|
|
4
4
|
import * as GenericUtils from './utils/generic';
|
|
5
|
-
|
|
5
|
+
import * as JSIdentifiers from './utils/js-identifiers';
|
|
6
|
+
import * as RoutePaths from './utils/route-paths';
|
|
7
|
+
export { Constants, StringUtils, UIDLUtils, GenericUtils, JSIdentifiers, RoutePaths };
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
|