@wildwinter/app-shell 0.49.0 → 0.51.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.
Files changed (46) hide show
  1. package/README.md +37 -0
  2. package/dist/{chunk-FGAPO4N5.js → chunk-B56FWJ5Y.js} +21 -12
  3. package/dist/chunk-B56FWJ5Y.js.map +1 -0
  4. package/dist/chunk-ELEDQRZ7.js +435 -0
  5. package/dist/chunk-ELEDQRZ7.js.map +1 -0
  6. package/dist/controls.css +107 -0
  7. package/dist/controls.css.map +1 -1
  8. package/dist/history.cjs +194 -0
  9. package/dist/history.cjs.map +1 -0
  10. package/dist/history.d.cts +111 -0
  11. package/dist/history.d.ts +111 -0
  12. package/dist/history.js +188 -0
  13. package/dist/history.js.map +1 -0
  14. package/dist/index.cjs +368 -9
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +2 -2
  19. package/dist/{property-list-BPGU3rhF.d.cts → property-list-DlpxIkv6.d.cts} +9 -0
  20. package/dist/{property-list-BPGU3rhF.d.ts → property-list-DlpxIkv6.d.ts} +9 -0
  21. package/dist/property-list.cjs +18 -9
  22. package/dist/property-list.cjs.map +1 -1
  23. package/dist/property-list.d.cts +1 -1
  24. package/dist/property-list.d.ts +1 -1
  25. package/dist/property-list.js +2 -2
  26. package/dist/value-control.cjs +584 -0
  27. package/dist/value-control.cjs.map +1 -1
  28. package/dist/value-control.d.cts +61 -1
  29. package/dist/value-control.d.ts +61 -1
  30. package/dist/value-control.js +1 -1
  31. package/dist/value-rows.cjs +1104 -0
  32. package/dist/value-rows.cjs.map +1 -0
  33. package/dist/value-rows.d.cts +71 -0
  34. package/dist/value-rows.d.ts +71 -0
  35. package/dist/value-rows.js +298 -0
  36. package/dist/value-rows.js.map +1 -0
  37. package/dist/window-guard.cjs +74 -0
  38. package/dist/window-guard.cjs.map +1 -0
  39. package/dist/window-guard.d.cts +32 -0
  40. package/dist/window-guard.d.ts +32 -0
  41. package/dist/window-guard.js +67 -0
  42. package/dist/window-guard.js.map +1 -0
  43. package/package.json +26 -4
  44. package/dist/chunk-EAE7UWQ5.js +0 -84
  45. package/dist/chunk-EAE7UWQ5.js.map +0 -1
  46. package/dist/chunk-FGAPO4N5.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { EDIT_MENU, FILE_MENU, GO_MENU, MenuLabel, PANE_MENU, PLAY_MENU, PUBLISH_MENU, REVIEW_MENU, VIEW_MENU } from './menu.cjs';
2
2
  export { HintBarItem, KeyHintOptions, KeyPlatform, hintBar, isKeyCombo, keyHint, keyLabel, keyLegends, keyPlatform, setKeyPlatform, tipWithKey } from './keys.cjs';
3
3
  export { ProblemCopy, ProblemCopyEntry, ProblemCopyTable, ProblemLike, defaultProblemCopy, describeProblem, problemLine, problemName } from './problems.cjs';
4
- export { D as DefaultControlOptions, a as DupGuard, P as PROPERTY_TYPES, b as PropertyDeclLike, c as PropertyListHandle, d as PropertyListOptions, e as PropertyListType, S as SettingsDialog, f as SettingsDialogOptions, g as SettingsSection, h as SettingsSectionHandle, i as defaultControl, j as dupGuard, k as expandableRow, l as focusNewRow, m as mountPropertyList, n as mountSettingsDialog, r as revealRow, o as revealRowWhenReady } from './property-list-BPGU3rhF.cjs';
4
+ export { D as DefaultControlOptions, a as DupGuard, P as PROPERTY_TYPES, b as PropertyDeclLike, c as PropertyListHandle, d as PropertyListOptions, e as PropertyListType, S as SettingsDialog, f as SettingsDialogOptions, g as SettingsSection, h as SettingsSectionHandle, i as defaultControl, j as dupGuard, k as expandableRow, l as focusNewRow, m as mountPropertyList, n as mountSettingsDialog, r as revealRow, o as revealRowWhenReady } from './property-list-DlpxIkv6.cjs';
5
5
  export { DialogFrame, DialogFrameOptions, dialogFrame } from './dialog.cjs';
6
6
  export { Floating, FloatingOptions, createFloating } from './floating.cjs';
7
7
  export { ContextItem, PopoverOptions, openContextMenu, openPopover } from './context-menu.cjs';
@@ -11,7 +11,7 @@ export { UpdaterDownloadProgress, UpdaterPromptOptions } from './updater.cjs';
11
11
  export { Welcome, WelcomeAction, WelcomeGroup, WelcomeGroupItem, WelcomeOptions, WelcomeRecent, mountWelcome } from './welcome.cjs';
12
12
  export { KitGallery, KitGalleryChoice, KitGalleryItem, KitGalleryOptions, KitGallerySection, kitTile, openKitGallery } from './kit-gallery.cjs';
13
13
  export { LinkStatus, LinkStatusChip, LinkStatusClass, LinkStatusOptions, linkAddress, linkStatusClass, linkStatusTip, mountLinkStatus } from './link-status.cjs';
14
- export { RungStripOptions, ValueDeclLike, defaultLabel, fallbackText, rungStrip, stageGateNote } from './value-control.cjs';
14
+ export { FieldDeclLike, FieldRowHandle, FieldRowOptions, FieldRows, FieldValue, RungStripOptions, ValueDeclLike, defaultLabel, fallbackText, fieldRow, fieldRows, fieldValueProblem, rungStrip, stageGateNote } from './value-control.cjs';
15
15
  export { Debounced, copyWithFeedback, debounce, formatCount, isEditableTarget, isLocalOrigin, plural, relativeTime } from './util.cjs';
16
16
  import './app-store.cjs';
17
17
  import 'electron';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { EDIT_MENU, FILE_MENU, GO_MENU, MenuLabel, PANE_MENU, PLAY_MENU, PUBLISH_MENU, REVIEW_MENU, VIEW_MENU } from './menu.js';
2
2
  export { HintBarItem, KeyHintOptions, KeyPlatform, hintBar, isKeyCombo, keyHint, keyLabel, keyLegends, keyPlatform, setKeyPlatform, tipWithKey } from './keys.js';
3
3
  export { ProblemCopy, ProblemCopyEntry, ProblemCopyTable, ProblemLike, defaultProblemCopy, describeProblem, problemLine, problemName } from './problems.js';
4
- export { D as DefaultControlOptions, a as DupGuard, P as PROPERTY_TYPES, b as PropertyDeclLike, c as PropertyListHandle, d as PropertyListOptions, e as PropertyListType, S as SettingsDialog, f as SettingsDialogOptions, g as SettingsSection, h as SettingsSectionHandle, i as defaultControl, j as dupGuard, k as expandableRow, l as focusNewRow, m as mountPropertyList, n as mountSettingsDialog, r as revealRow, o as revealRowWhenReady } from './property-list-BPGU3rhF.js';
4
+ export { D as DefaultControlOptions, a as DupGuard, P as PROPERTY_TYPES, b as PropertyDeclLike, c as PropertyListHandle, d as PropertyListOptions, e as PropertyListType, S as SettingsDialog, f as SettingsDialogOptions, g as SettingsSection, h as SettingsSectionHandle, i as defaultControl, j as dupGuard, k as expandableRow, l as focusNewRow, m as mountPropertyList, n as mountSettingsDialog, r as revealRow, o as revealRowWhenReady } from './property-list-DlpxIkv6.js';
5
5
  export { DialogFrame, DialogFrameOptions, dialogFrame } from './dialog.js';
6
6
  export { Floating, FloatingOptions, createFloating } from './floating.js';
7
7
  export { ContextItem, PopoverOptions, openContextMenu, openPopover } from './context-menu.js';
@@ -11,7 +11,7 @@ export { UpdaterDownloadProgress, UpdaterPromptOptions } from './updater.js';
11
11
  export { Welcome, WelcomeAction, WelcomeGroup, WelcomeGroupItem, WelcomeOptions, WelcomeRecent, mountWelcome } from './welcome.js';
12
12
  export { KitGallery, KitGalleryChoice, KitGalleryItem, KitGalleryOptions, KitGallerySection, kitTile, openKitGallery } from './kit-gallery.js';
13
13
  export { LinkStatus, LinkStatusChip, LinkStatusClass, LinkStatusOptions, linkAddress, linkStatusClass, linkStatusTip, mountLinkStatus } from './link-status.js';
14
- export { RungStripOptions, ValueDeclLike, defaultLabel, fallbackText, rungStrip, stageGateNote } from './value-control.js';
14
+ export { FieldDeclLike, FieldRowHandle, FieldRowOptions, FieldRows, FieldValue, RungStripOptions, ValueDeclLike, defaultLabel, fallbackText, fieldRow, fieldRows, fieldValueProblem, rungStrip, stageGateNote } from './value-control.js';
15
15
  export { Debounced, copyWithFeedback, debounce, formatCount, isEditableTarget, isLocalOrigin, plural, relativeTime } from './util.js';
16
16
  import './app-store.js';
17
17
  import 'electron';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { mountWelcome } from './chunk-XSS7KM6F.js';
2
2
  export { feedUpdaterDownloadProgress, showUpdaterDialog } from './chunk-C245WRPF.js';
3
3
  export { defaultProblemCopy, describeProblem, problemLine, problemName } from './chunk-4OAORWEM.js';
4
- export { PROPERTY_NAME_HINT, PROPERTY_TYPES, RESERVED_PROPERTY_NAMES, bindPropertyName, bindPropertyRef, defaultControl, dupGuard, expandableRow, firstIllegalPropertyName, focusNewRow, isCaseOnlyPropertyName, isValidPropertyName, mountPropertyList, mountSettingsDialog, propertyNameProblem, propertyNameify, propertyRefProblem, revalidatePropertyRefs, revealRow, revealRowWhenReady } from './chunk-FGAPO4N5.js';
5
- export { defaultLabel, fallbackText, rungStrip, stageGateNote } from './chunk-EAE7UWQ5.js';
4
+ export { PROPERTY_NAME_HINT, PROPERTY_TYPES, RESERVED_PROPERTY_NAMES, bindPropertyName, bindPropertyRef, defaultControl, dupGuard, expandableRow, firstIllegalPropertyName, focusNewRow, isCaseOnlyPropertyName, isValidPropertyName, mountPropertyList, mountSettingsDialog, propertyNameProblem, propertyNameify, propertyRefProblem, revalidatePropertyRefs, revealRow, revealRowWhenReady } from './chunk-B56FWJ5Y.js';
5
+ export { defaultLabel, fallbackText, fieldRow, fieldRows, fieldValueProblem, rungStrip, stageGateNote } from './chunk-ELEDQRZ7.js';
6
6
  import { isKeyCombo, tipWithKey } from './chunk-YWMSQFXX.js';
7
7
  export { hintBar, isKeyCombo, keyHint, keyLabel, keyLegends, keyPlatform, setKeyPlatform, tipWithKey } from './chunk-YWMSQFXX.js';
8
8
  export { kitTile, openKitGallery } from './chunk-62KWJPRP.js';
@@ -162,6 +162,15 @@ interface PropertyListOptions<T extends PropertyDeclLike> extends DefaultControl
162
162
  extraDetails?: (decl: T, index: number) => (HTMLElement | null)[];
163
163
  /** Offer the Purpose field. Default true. */
164
164
  purpose?: boolean;
165
+ /** What a row declares, in the row's own words ("Field name", "What this field is for", "Delete
166
+ * field"). Default "property". */
167
+ noun?: string;
168
+ /**
169
+ * The rule a name follows. `"property"` (default): the property-name rules, bound and gated, since an
170
+ * expression must be able to reach it. `"free"`: any name, only duplicates refused, for a declaration no
171
+ * expression reads (a Patterpad game-data field's name is the host's word).
172
+ */
173
+ names?: "property" | "free";
165
174
  /**
166
175
  * A quality's stage was renamed in place (the declaration's own default
167
176
  * already follows it). Given, the rename is handed here INSTEAD of
@@ -162,6 +162,15 @@ interface PropertyListOptions<T extends PropertyDeclLike> extends DefaultControl
162
162
  extraDetails?: (decl: T, index: number) => (HTMLElement | null)[];
163
163
  /** Offer the Purpose field. Default true. */
164
164
  purpose?: boolean;
165
+ /** What a row declares, in the row's own words ("Field name", "What this field is for", "Delete
166
+ * field"). Default "property". */
167
+ noun?: string;
168
+ /**
169
+ * The rule a name follows. `"property"` (default): the property-name rules, bound and gated, since an
170
+ * expression must be able to reach it. `"free"`: any name, only duplicates refused, for a declaration no
171
+ * expression reads (a Patterpad game-data field's name is the host's word).
172
+ */
173
+ names?: "property" | "free";
165
174
  /**
166
175
  * A quality's stage was renamed in place (the declaration's own default
167
176
  * already follows it). Given, the rename is handed here INSTEAD of
@@ -764,17 +764,26 @@ function mountPropertyList(host, decls, opts = {}) {
764
764
  const types = opts.types ?? PROPERTY_TYPES;
765
765
  const list = el("div", "set-list");
766
766
  const keep = (parts) => (parts ?? []).filter((p) => p !== null);
767
+ const noun = opts.noun ?? "property";
768
+ const Noun = noun.charAt(0).toUpperCase() + noun.slice(1);
769
+ const freeNames = opts.names === "free";
767
770
  const row = (p, i) => {
768
771
  const name = el("input", "field set-name");
769
772
  name.type = "text";
770
- name.placeholder = "Property name";
773
+ name.placeholder = `${Noun} name`;
771
774
  name.value = p.name;
772
775
  name.spellcheck = false;
773
- name.dataset["tip"] = PROPERTY_NAME_HINT;
774
- bindPropertyName(name, (v) => {
775
- p.name = v;
776
+ if (freeNames) name.addEventListener("input", () => {
777
+ p.name = name.value;
776
778
  changed();
777
- }, { hint: PROPERTY_NAME_HINT });
779
+ });
780
+ else {
781
+ name.dataset["tip"] = PROPERTY_NAME_HINT;
782
+ bindPropertyName(name, (v) => {
783
+ p.name = v;
784
+ changed();
785
+ }, { hint: PROPERTY_NAME_HINT });
786
+ }
778
787
  guard.track(name);
779
788
  const type = el("select", "field set-type");
780
789
  for (const [v, label] of types) type.append(option(v, label, v === p.type));
@@ -807,7 +816,7 @@ function mountPropertyList(host, decls, opts = {}) {
807
816
  changed();
808
817
  }
809
818
  }, i === decls.length - 1);
810
- const del = iconBtn("close", "Delete property", () => {
819
+ const del = iconBtn("close", `Delete ${noun}`, () => {
811
820
  decls.splice(i, 1);
812
821
  render();
813
822
  changed();
@@ -832,7 +841,7 @@ function mountPropertyList(host, decls, opts = {}) {
832
841
  if (opts.purpose !== false) {
833
842
  const purpose = el("input", "field set-purpose");
834
843
  purpose.type = "text";
835
- purpose.placeholder = "What this property is for";
844
+ purpose.placeholder = `What this ${noun} is for`;
836
845
  purpose.value = p.purpose ?? "";
837
846
  purpose.addEventListener("input", () => {
838
847
  if (purpose.value.trim()) p.purpose = purpose.value;
@@ -862,9 +871,9 @@ function mountPropertyList(host, decls, opts = {}) {
862
871
  host.append(list, add);
863
872
  return {
864
873
  firstDuplicate: () => guard.firstDuplicate(),
865
- firstIllegalName: () => firstIllegalPropertyName(host),
874
+ firstIllegalName: () => freeNames ? null : firstIllegalPropertyName(host),
866
875
  // The Save gate takes both faults; the field's own rollover says which.
867
- firstInvalid: () => guard.firstDuplicate() ?? firstIllegalPropertyName(host),
876
+ firstInvalid: () => guard.firstDuplicate() ?? (freeNames ? null : firstIllegalPropertyName(host)),
868
877
  render
869
878
  };
870
879
  }