@wildwinter/app-shell 0.28.0 → 0.29.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/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/settings.css +4 -0
- package/dist/settings.css.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -872,6 +872,25 @@ function isValidGameId(gameId) {
|
|
|
872
872
|
return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(gameId);
|
|
873
873
|
}
|
|
874
874
|
|
|
875
|
+
// src/property-names.ts
|
|
876
|
+
var RESERVED_PROPERTY_NAMES = ["true", "false", "and", "or", "not"];
|
|
877
|
+
var PROPERTY_NAME_HINT = "Lower case letters, digits and underscores. Cannot start with a digit. No hyphens or spaces.";
|
|
878
|
+
function propertyNameify(text) {
|
|
879
|
+
const trimmed = text.trim();
|
|
880
|
+
const deliberateLeading = trimmed.startsWith("_");
|
|
881
|
+
let out = trimmed.toLowerCase().replace(/['’]/g, "").replace(/[^a-z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
|
|
882
|
+
if (out === "") return "";
|
|
883
|
+
if (deliberateLeading || /^[0-9]/.test(out)) out = `_${out}`;
|
|
884
|
+
if (RESERVED_PROPERTY_NAMES.includes(out)) out = `${out}_`;
|
|
885
|
+
return out;
|
|
886
|
+
}
|
|
887
|
+
function isValidPropertyName(name) {
|
|
888
|
+
return /^[a-z_][a-z0-9_]*$/.test(name) && !RESERVED_PROPERTY_NAMES.includes(name);
|
|
889
|
+
}
|
|
890
|
+
function isCaseOnlyPropertyName(name) {
|
|
891
|
+
return !isValidPropertyName(name) && isValidPropertyName(name.toLowerCase());
|
|
892
|
+
}
|
|
893
|
+
|
|
875
894
|
// src/id-editor.ts
|
|
876
895
|
function openGameIdEditor(opts) {
|
|
877
896
|
const slugify = opts.slugify ?? gameIdify;
|
|
@@ -1540,6 +1559,8 @@ exports.JOB_PROGRESS = JOB_PROGRESS;
|
|
|
1540
1559
|
exports.PALETTE = PALETTE;
|
|
1541
1560
|
exports.PALETTE_SIZE = PALETTE_SIZE;
|
|
1542
1561
|
exports.PANE_MENU = PANE_MENU;
|
|
1562
|
+
exports.PROPERTY_NAME_HINT = PROPERTY_NAME_HINT;
|
|
1563
|
+
exports.RESERVED_PROPERTY_NAMES = RESERVED_PROPERTY_NAMES;
|
|
1543
1564
|
exports.askIdentity = askIdentity;
|
|
1544
1565
|
exports.closeAnchoredPanel = closeAnchoredPanel;
|
|
1545
1566
|
exports.closeWithExit = closeWithExit;
|
|
@@ -1558,7 +1579,9 @@ exports.icon = icon;
|
|
|
1558
1579
|
exports.iconBtn = iconBtn;
|
|
1559
1580
|
exports.iconSvg = iconSvg;
|
|
1560
1581
|
exports.initTooltips = initTooltips;
|
|
1582
|
+
exports.isCaseOnlyPropertyName = isCaseOnlyPropertyName;
|
|
1561
1583
|
exports.isValidGameId = isValidGameId;
|
|
1584
|
+
exports.isValidPropertyName = isValidPropertyName;
|
|
1562
1585
|
exports.labelled = labelled;
|
|
1563
1586
|
exports.lockControls = lockControls;
|
|
1564
1587
|
exports.lockNotice = lockNotice;
|
|
@@ -1573,6 +1596,7 @@ exports.openNotesEditor = openNotesEditor;
|
|
|
1573
1596
|
exports.paintVcBadges = paintVcBadges;
|
|
1574
1597
|
exports.pinButton = pinButton;
|
|
1575
1598
|
exports.placeAnchored = placeAnchored;
|
|
1599
|
+
exports.propertyNameify = propertyNameify;
|
|
1576
1600
|
exports.renderStepperBar = renderStepperBar;
|
|
1577
1601
|
exports.saveIndicator = saveIndicator;
|
|
1578
1602
|
exports.showAbout = showAbout;
|