jaml-ui 2.4.0 → 3.0.1

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 (171) hide show
  1. package/README.md +38 -225
  2. package/dist/chunks/Layer-B5y9UIAt.js +19 -0
  3. package/dist/chunks/Layer-B5y9UIAt.js.map +1 -0
  4. package/dist/chunks/motelySprite-BYsaes3N.js +753 -0
  5. package/dist/chunks/motelySprite-BYsaes3N.js.map +1 -0
  6. package/dist/chunks/spriteMapper-BiDkbZrD.js +480 -0
  7. package/dist/chunks/spriteMapper-BiDkbZrD.js.map +1 -0
  8. package/dist/components/DeckSprite.d.ts +1 -1
  9. package/dist/components/GameCard.d.ts +5 -4
  10. package/dist/components/JamlyzerView.d.ts +9 -0
  11. package/dist/components/StandardCard.d.ts +4 -3
  12. package/dist/core.d.ts +0 -1
  13. package/dist/core.js +38 -23
  14. package/dist/core.js.map +1 -1
  15. package/dist/decode/motelyItemDecoder.d.ts +5 -0
  16. package/dist/index.d.ts +6 -26
  17. package/dist/index.js +3177 -22506
  18. package/dist/index.js.map +1 -1
  19. package/dist/json-render/builders/analyzer.d.ts +23 -0
  20. package/dist/json-render/builders/encyclopedia.d.ts +14 -0
  21. package/dist/json-render/builders/search.d.ts +24 -0
  22. package/dist/json-render/catalog.d.ts +204 -0
  23. package/dist/json-render/components/domain.d.ts +58 -0
  24. package/dist/json-render/components/game.d.ts +18 -0
  25. package/dist/json-render/components/layout.d.ts +51 -0
  26. package/dist/json-render/components/mascot.d.ts +22 -0
  27. package/dist/json-render/components/reference.d.ts +38 -0
  28. package/dist/json-render/engine.d.ts +38 -0
  29. package/dist/json-render/index.d.ts +30 -0
  30. package/dist/json-render/knowledge/bosses.d.ts +18 -0
  31. package/dist/json-render/knowledge/decks.d.ts +22 -0
  32. package/dist/json-render/knowledge/jokers.d.ts +23 -0
  33. package/dist/json-render/knowledge/synergies.d.ts +21 -0
  34. package/dist/json-render/registry.d.ts +14 -0
  35. package/dist/motely.d.ts +1 -4
  36. package/dist/motely.js +23 -154
  37. package/dist/motely.js.map +1 -1
  38. package/dist/render/CanvasRenderer.d.ts +2 -1
  39. package/dist/render/useJamlCardRenderer.d.ts +15 -0
  40. package/dist/ui/jimbo.css +1 -2
  41. package/dist/ui.d.ts +0 -40
  42. package/dist/ui.js +58 -3
  43. package/dist/ui.js.map +1 -0
  44. package/package.json +23 -68
  45. package/dist/assets/searchPoolWorker-BdrYmnig.js +0 -2
  46. package/dist/assets/searchPoolWorker-BdrYmnig.js.map +0 -1
  47. package/dist/chunks/jamlSeeds-CKHvpjhC.js +0 -66
  48. package/dist/chunks/jamlSeeds-CKHvpjhC.js.map +0 -1
  49. package/dist/chunks/runtime-Dx5VPTsV.js +0 -2031
  50. package/dist/chunks/runtime-Dx5VPTsV.js.map +0 -1
  51. package/dist/chunks/searchPoolWorker-CEK2FyxS.js +0 -11
  52. package/dist/chunks/searchPoolWorker-CEK2FyxS.js.map +0 -1
  53. package/dist/chunks/spriteMapper-C8uYedXB.js +0 -2455
  54. package/dist/chunks/spriteMapper-C8uYedXB.js.map +0 -1
  55. package/dist/chunks/ui-BK5rM4AS.js +0 -3479
  56. package/dist/chunks/ui-BK5rM4AS.js.map +0 -1
  57. package/dist/components/CardFan.d.ts +0 -13
  58. package/dist/components/JamlAestheticSelector.d.ts +0 -12
  59. package/dist/components/JamlCodeEditor.d.ts +0 -7
  60. package/dist/components/JamlIde.d.ts +0 -44
  61. package/dist/components/JamlIdeToolbar.d.ts +0 -14
  62. package/dist/components/JamlIdeVisual.d.ts +0 -32
  63. package/dist/components/JamlMapPreview.d.ts +0 -11
  64. package/dist/components/JamlSeedInput.d.ts +0 -24
  65. package/dist/components/JamlSeedSpinner.d.ts +0 -9
  66. package/dist/components/JamlSpeedometer.d.ts +0 -16
  67. package/dist/components/Jamlyzer.d.ts +0 -8
  68. package/dist/components/JimmolateEditor.d.ts +0 -47
  69. package/dist/components/MotelyHello.d.ts +0 -5
  70. package/dist/components/MotelyVersionBadge.d.ts +0 -28
  71. package/dist/components/PaginatedFilterBrowser.d.ts +0 -26
  72. package/dist/components/RunConfigModal.d.ts +0 -8
  73. package/dist/components/SeedFinderApp.d.ts +0 -7
  74. package/dist/components/jamlMap/CategoryPicker.d.ts +0 -32
  75. package/dist/components/jamlMap/JamlMapEditor.d.ts +0 -14
  76. package/dist/components/jamlMap/JokerPicker.d.ts +0 -8
  77. package/dist/components/jamlMap/MysterySlot.d.ts +0 -37
  78. package/dist/components/jamlMap/index.d.ts +0 -4
  79. package/dist/components/jamlMap/jokerRarity.d.ts +0 -6
  80. package/dist/components/jamlSeedUtils.d.ts +0 -1
  81. package/dist/hooks/searchPoolWorker.d.ts +0 -61
  82. package/dist/hooks/searchWorker.d.ts +0 -1
  83. package/dist/hooks/useAnalyzer.d.ts +0 -15
  84. package/dist/hooks/useIntersectionObserver.d.ts +0 -14
  85. package/dist/hooks/useJamlLibrary.d.ts +0 -13
  86. package/dist/hooks/useSearch.d.ts +0 -32
  87. package/dist/hooks/useSearchPool.d.ts +0 -43
  88. package/dist/hooks/useShopStream.d.ts +0 -22
  89. package/dist/lib/SpriteMapper.d.ts +0 -10
  90. package/dist/lib/cardParser.d.ts +0 -8
  91. package/dist/lib/classes/BuyMetaData.d.ts +0 -11
  92. package/dist/lib/config.d.ts +0 -13
  93. package/dist/lib/const.d.ts +0 -70
  94. package/dist/lib/data/constants.d.ts +0 -11
  95. package/dist/lib/hooks/useDragScroll.d.ts +0 -4
  96. package/dist/lib/hooks/useJamlFilter.d.ts +0 -48
  97. package/dist/lib/hooks/useSeedAnalyzer.d.ts +0 -17
  98. package/dist/lib/jaml/jamlCompletion.d.ts +0 -12
  99. package/dist/lib/jaml/jamlData.d.ts +0 -4
  100. package/dist/lib/jaml/jamlLangCodemirror.d.ts +0 -22
  101. package/dist/lib/jaml/jamlObjectives.d.ts +0 -13
  102. package/dist/lib/jaml/jamlParser.d.ts +0 -14
  103. package/dist/lib/jaml/jamlPresets.d.ts +0 -8
  104. package/dist/lib/jaml/jamlSchema.d.ts +0 -19
  105. package/dist/lib/jaml/jamlSeeds.d.ts +0 -7
  106. package/dist/lib/motely/runtime.d.ts +0 -13
  107. package/dist/lib/parseDailyRitual.d.ts +0 -45
  108. package/dist/lib/tts/getRevealPos.d.ts +0 -5
  109. package/dist/lib/tts/splitTtsDisplay.d.ts +0 -19
  110. package/dist/lib/types.d.ts +0 -122
  111. package/dist/motelyDisplay.d.ts +0 -10
  112. package/dist/r3f/Card3D.d.ts +0 -48
  113. package/dist/r3f/CardTable.d.ts +0 -35
  114. package/dist/r3f.d.ts +0 -2
  115. package/dist/r3f.js +0 -275
  116. package/dist/r3f.js.map +0 -1
  117. package/dist/ui/JimboBadge.d.ts +0 -12
  118. package/dist/ui/JimboBalatroFooter.d.ts +0 -16
  119. package/dist/ui/JimboCookLever.d.ts +0 -30
  120. package/dist/ui/JimboCopyButton.d.ts +0 -27
  121. package/dist/ui/JimboDeckAndStakeSelectorModal.d.ts +0 -30
  122. package/dist/ui/JimboDualChip.d.ts +0 -17
  123. package/dist/ui/JimboIconButton.d.ts +0 -15
  124. package/dist/ui/JimboInlineEdit.d.ts +0 -16
  125. package/dist/ui/JimboInputModal.d.ts +0 -13
  126. package/dist/ui/JimboListItem.d.ts +0 -11
  127. package/dist/ui/JimboPanelSpinner.d.ts +0 -15
  128. package/dist/ui/JimboPicker.d.ts +0 -28
  129. package/dist/ui/JimboSeedCopyChip.d.ts +0 -16
  130. package/dist/ui/JimboSelect.d.ts +0 -30
  131. package/dist/ui/JimboSlider.d.ts +0 -11
  132. package/dist/ui/JimboSpinner.d.ts +0 -18
  133. package/dist/ui/JimboStepper.d.ts +0 -22
  134. package/dist/ui/JimboTextInput.d.ts +0 -5
  135. package/dist/ui/JimboToggleList.d.ts +0 -12
  136. package/dist/ui/JimboValueBadge.d.ts +0 -19
  137. package/dist/ui/codeBlock.d.ts +0 -11
  138. package/dist/ui/hooks.d.ts +0 -126
  139. package/dist/ui/ide/JamlEditor.d.ts +0 -7
  140. package/dist/ui/jimboApp.d.ts +0 -9
  141. package/dist/ui/jimboBackground.d.ts +0 -17
  142. package/dist/ui/jimboCopyRow.d.ts +0 -9
  143. package/dist/ui/jimboFilterBar.d.ts +0 -22
  144. package/dist/ui/jimboFlankNav.d.ts +0 -17
  145. package/dist/ui/jimboInfoCard.d.ts +0 -31
  146. package/dist/ui/jimboInset.d.ts +0 -9
  147. package/dist/ui/jimboLayout.d.ts +0 -25
  148. package/dist/ui/jimboLink.d.ts +0 -12
  149. package/dist/ui/jimboSectionHeader.d.ts +0 -11
  150. package/dist/ui/jimboStatGrid.d.ts +0 -13
  151. package/dist/ui/jimboTabs.d.ts +0 -21
  152. package/dist/ui/jimboText.d.ts +0 -25
  153. package/dist/ui/jimboTooltip.d.ts +0 -33
  154. package/dist/ui/jimboWordmark.d.ts +0 -10
  155. package/dist/ui/mascot/JammySpeechBox.d.ts +0 -9
  156. package/dist/ui/mascot/SeedMascot.d.ts +0 -37
  157. package/dist/ui/mascot/index.d.ts +0 -3
  158. package/dist/ui/mascot/menuConfig.d.ts +0 -102
  159. package/dist/ui/panel.d.ts +0 -32
  160. package/dist/ui/radial/RadialBadge.d.ts +0 -16
  161. package/dist/ui/radial/RadialBreadcrumb.d.ts +0 -12
  162. package/dist/ui/radial/RadialButton.d.ts +0 -60
  163. package/dist/ui/radial/RadialMenu.d.ts +0 -38
  164. package/dist/ui/radial/RadialPill.d.ts +0 -17
  165. package/dist/ui/radial/index.d.ts +0 -16
  166. package/dist/ui/radial/radialMenuStore.d.ts +0 -31
  167. package/dist/ui/radial/radialMenuViewport.d.ts +0 -6
  168. package/dist/ui/radial/useRadialMenu.d.ts +0 -35
  169. package/dist/ui/sprites.d.ts +0 -25
  170. package/dist/utils/jamlMapPreview.d.ts +0 -12
  171. package/dist/utils/jamlVisualFilter.d.ts +0 -3
package/dist/ui.js CHANGED
@@ -1,3 +1,58 @@
1
- "use client";
2
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as L, i as R, it as z, j as B, k as V, l as H, lt as U, m as W, n as G, nt as K, o as q, p as J, q as Y, r as X, rt as Z, s as Q, t as $, tt as ee, u as te, ut as ne, v as re, w as ie, x as ae, y as oe, z as se } from "./chunks/ui-BK5rM4AS.js";
3
- export { Z as DeckSprite, M as JIMBO_ANIMATIONS, j as JamlEditor, y as JimboApp, r as JimboAppFooter, ie as JimboAppScroll, c as JimboBackButton, B as JimboBackground, f as JimboBadge, a as JimboBalatroFooter, x as JimboButton, h as JimboCodeBlock, U as JimboColorOption, $ as JimboCookLever, V as JimboCopyButton, b as JimboCopyRow, H as JimboDeckAndStakeSelectorModal, G as JimboDualChip, p as JimboFilterBar, l as JimboFlankNav, se as JimboIconButton, L as JimboInfoCard, I as JimboInfoCardAside, D as JimboInfoCardBody, re as JimboInfoCardSub, oe as JimboInfoCardTitle, v as JimboInlineEdit, C as JimboInnerPanel, Q as JimboInputModal, N as JimboInset, i as JimboLink, n as JimboListItem, s as JimboModal, d as JimboPanel, te as JimboPanelSpinner, Y as JimboPicker, u as JimboPickerEmpty, T as JimboPickerGrid, w as JimboPickerHint, E as JimboPickerItem, _ as JimboPickerPair, e as JimboPickerSearch, P as JimboPickerSection, F as JimboRow, A as JimboSectionHeader, o as JimboSeedCopyChip, q as JimboSelect, X as JimboSlider, g as JimboSpinner, z as JimboSprite, J as JimboStack, W as JimboStatGrid, O as JimboStepper, S as JimboTabs, K as JimboText, ee as JimboTextInput, m as JimboToggleList, t as JimboTooltip, R as JimboValueBadge, ae as JimboWordmark, k as StakeSprite, ne as withAlpha };
1
+ const e = {
2
+ RED: "#ff4c40",
3
+ BLUE: "#0093ff",
4
+ GREEN: "#429f79",
5
+ ORANGE: "#ff9800",
6
+ GOLD: "#e4b643",
7
+ PURPLE: "#9e74ce",
8
+ DARK_RED: "#a02721",
9
+ DARK_BLUE: "#0057a1",
10
+ DARK_ORANGE: "#a05b00",
11
+ DARK_GREEN: "#215f46",
12
+ DARK_PURPLE: "#5e437e",
13
+ DARK_GREY: "#3a5055",
14
+ DARKEST: "#1e2b2d",
15
+ GREY: "#708386",
16
+ TEAL_GREY: "#404c4e",
17
+ PANEL_EDGE: "#1e2e32",
18
+ INNER_BORDER: "#334461",
19
+ BORDER_SILVER: "#b9c2d2",
20
+ BORDER_SOUTH: "#777e89",
21
+ GOLD_TEXT: "#e4b643",
22
+ GREEN_TEXT: "#35bd86",
23
+ ORANGE_TEXT: "#ff8f00",
24
+ WHITE: "#ffffff",
25
+ BLACK: "#000000",
26
+ TAROT_BUTTON: "#9e74ce",
27
+ PLANET_BUTTON: "#00a7ca",
28
+ SPECTRAL_BUTTON: "#2e76fd",
29
+ TAROT_BUTTON_DARK: "#5e437e",
30
+ PLANET_BUTTON_DARK: "#00657c",
31
+ SPECTRAL_BUTTON_DARK: "#14449e"
32
+ };
33
+ function O(R, T) {
34
+ const E = R.replace("#", ""), _ = parseInt(E.slice(0, 2), 16), A = parseInt(E.slice(2, 4), 16), N = parseInt(E.slice(4, 6), 16);
35
+ return `rgba(${_}, ${A}, ${N}, ${T})`;
36
+ }
37
+ const U = {
38
+ JUICE_UP_SCALE: 1.05,
39
+ JUICE_DOWN_SCALE: 1,
40
+ JUICE_DURATION: 150,
41
+ JUICE_EASING: "cubic-bezier(0.34, 1.56, 0.64, 1)",
42
+ SWAY_AMOUNT: 1.5,
43
+ SWAY_DURATION: 4e3,
44
+ PRESS_TRANSLATE_Y: 2,
45
+ PRESS_DURATION: 50,
46
+ CARD_TILT_MAX: 6,
47
+ MENU_SINK_DURATION: 200,
48
+ MENU_RISE_DURATION: 300,
49
+ MENU_ORBIT_DURATION: 320,
50
+ LETTER_POP_RATE: 3,
51
+ LETTER_BUMP_RATE: 2.666
52
+ };
53
+ export {
54
+ U as JIMBO_ANIMATIONS,
55
+ e as JimboColorOption,
56
+ O as withAlpha
57
+ };
58
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sources":["../src/ui/tokens.ts"],"sourcesContent":["/**\n * Balatro design tokens — colors eyedropped from actual game pixels.\n * Do NOT replace with Lua HEX values; the game's shader pipeline transforms them.\n *\n * IMPORTANT: For DOM components, use CSS custom properties (--j-red, etc.)\n * from jimbo.css. Only use these JS constants for contexts that cannot use\n * CSS — such as R3F/Canvas, inline SVG fills, or imperative animation APIs.\n */\n\nexport const JimboColorOption = {\n RED: '#ff4c40',\n BLUE: '#0093ff',\n GREEN: '#429f79',\n ORANGE: '#ff9800',\n GOLD: '#e4b643',\n PURPLE: '#9e74ce',\n\n DARK_RED: '#a02721',\n DARK_BLUE: '#0057a1',\n DARK_ORANGE: '#a05b00',\n DARK_GREEN: '#215f46',\n DARK_PURPLE: '#5e437e',\n\n DARK_GREY: '#3a5055',\n DARKEST: '#1e2b2d',\n GREY: '#708386',\n TEAL_GREY: '#404c4e',\n\n PANEL_EDGE: '#1e2e32',\n INNER_BORDER: '#334461',\n\n BORDER_SILVER: '#b9c2d2',\n BORDER_SOUTH: '#777e89',\n\n GOLD_TEXT: '#e4b643',\n GREEN_TEXT: '#35bd86',\n ORANGE_TEXT: '#ff8f00',\n WHITE: '#ffffff',\n BLACK: '#000000',\n\n TAROT_BUTTON: '#9e74ce',\n PLANET_BUTTON: '#00a7ca',\n SPECTRAL_BUTTON: '#2e76fd',\n TAROT_BUTTON_DARK: '#5e437e',\n PLANET_BUTTON_DARK: '#00657c',\n SPECTRAL_BUTTON_DARK: '#14449e',\n} as const\n\nexport type JimboPaletteColor = keyof typeof JimboColorOption\n\n/** Convert hex to rgba for inline styles in Canvas/SVG/R3F contexts. */\nexport function withAlpha(hex: string, alpha: number): string {\n const clean = hex.replace('#', '')\n const r = parseInt(clean.slice(0, 2), 16)\n const g = parseInt(clean.slice(2, 4), 16)\n const b = parseInt(clean.slice(4, 6), 16)\n return `rgba(${r}, ${g}, ${b}, ${alpha})`\n}\n\nexport const JIMBO_ANIMATIONS = {\n JUICE_UP_SCALE: 1.05,\n JUICE_DOWN_SCALE: 1.0,\n JUICE_DURATION: 150,\n JUICE_EASING: 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n SWAY_AMOUNT: 1.5,\n SWAY_DURATION: 4000,\n PRESS_TRANSLATE_Y: 2,\n PRESS_DURATION: 50,\n CARD_TILT_MAX: 6,\n MENU_SINK_DURATION: 200,\n MENU_RISE_DURATION: 300,\n MENU_ORBIT_DURATION: 320,\n LETTER_POP_RATE: 3,\n LETTER_BUMP_RATE: 2.666,\n} as const\n\n"],"names":["JimboColorOption","withAlpha","hex","alpha","clean","r","g","b","JIMBO_ANIMATIONS"],"mappings":"AASO,MAAMA,IAAmB;AAAA,EAC9B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EAER,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EAEb,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,YAAY;AAAA,EACZ,cAAc;AAAA,EAEd,eAAe;AAAA,EACf,cAAc;AAAA,EAEd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EAEP,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,sBAAsB;AACxB;AAKO,SAASC,EAAUC,GAAaC,GAAuB;AAC5D,QAAMC,IAAQF,EAAI,QAAQ,KAAK,EAAE,GAC3BG,IAAI,SAASD,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAClCE,IAAI,SAASF,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAClCG,IAAI,SAASH,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE;AACxC,SAAO,QAAQC,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKJ,CAAK;AACxC;AAEO,MAAMK,IAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,kBAAkB;AACpB;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jaml-ui",
3
- "version": "2.4.0",
4
- "description": "Balatro rendering components, sprite metadata, and optional Motely helpers for React apps.",
3
+ "version": "3.0.1",
4
+ "description": "Zero-dependency json-render engine + Balatro card sprites for MCP Apps.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -22,17 +22,12 @@
22
22
  "types": "./dist/motely.d.ts",
23
23
  "default": "./dist/motely.js"
24
24
  },
25
- "./r3f": {
26
- "types": "./dist/r3f.d.ts",
27
- "default": "./dist/r3f.js"
28
- },
29
25
  "./jimbo.css": "./dist/ui/jimbo.css",
30
26
  "./fonts.css": "./fonts.css",
31
27
  "./assets/*": "./assets/*"
32
28
  },
33
29
  "sideEffects": [
34
30
  "./fonts.css",
35
- "./dist/ui.js",
36
31
  "./dist/ui/jimbo.css",
37
32
  "./dist/index.js"
38
33
  ],
@@ -41,19 +36,16 @@
41
36
  "assets/*.png",
42
37
  "assets/fonts",
43
38
  "fonts.css",
44
- "dist/ui/jimbo.css",
45
39
  "README.md",
46
40
  "LICENSE"
47
41
  ],
48
42
  "scripts": {
49
43
  "build": "vite build",
50
44
  "dev": "vite build --watch",
51
- "demo": "vite --config demo/vite.config.ts",
52
45
  "typecheck": "tsc --noEmit --pretty false",
53
46
  "prepack": "npm run build",
54
47
  "storybook": "storybook dev -p 3141",
55
48
  "build-storybook": "storybook build",
56
- "serve:storybook": "npx --yes serve storybook-static -l tcp://0.0.0.0:3141 --cors",
57
49
  "lint": "eslint ."
58
50
  },
59
51
  "engines": {
@@ -77,75 +69,38 @@
77
69
  "seed",
78
70
  "card",
79
71
  "sprite",
80
- "ui"
72
+ "ui",
73
+ "json-render",
74
+ "mcp"
81
75
  ],
82
76
  "author": "pifreak",
83
77
  "license": "MIT",
84
78
  "peerDependencies": {
85
- "motely-wasm": ">=22.0.0",
79
+ "motely-wasm": "^23.3.0",
86
80
  "react": "^18.2.0 || ^19.0.0",
87
- "react-dom": "^18.2.0 || ^19.0.0",
88
- "react-icons": ">=5.0.0"
89
- },
90
- "peerDependenciesMeta": {
91
- "@rewaffle/bootsharp-file-system": {
92
- "optional": true
93
- },
94
- "react-icons": {
95
- "optional": true
96
- }
81
+ "react-dom": "^18.2.0 || ^19.0.0"
97
82
  },
98
83
  "devDependencies": {
99
- "@chromatic-com/storybook": "^5.2.1",
100
84
  "@eslint/js": "^10.0.1",
101
- "@rewaffle/bootsharp-file-system": "link:D:/extra/bootsharp/dist/packages/file-system",
102
- "@storybook/addon-a11y": "^10.4.0",
103
- "@storybook/addon-docs": "^10.4.0",
104
- "@storybook/addon-mcp": "^0.6.0",
105
- "@storybook/addon-vitest": "^10.4.0",
106
- "@storybook/react-vite": "^10.4.0",
107
- "@types/node": "^25.8.0",
108
- "@types/react": "^19.2.14",
85
+ "@types/node": "^25.9.4",
86
+ "@types/react": "^19.2.17",
109
87
  "@types/react-dom": "^19.2.3",
110
- "@types/three": "^0.184.1",
88
+ "@storybook/react": "^10.4.6",
89
+ "@storybook/react-vite": "^10.4.6",
111
90
  "@vitejs/plugin-react": "^5.2.0",
112
- "@vitest/browser-playwright": "^4.1.6",
113
- "@vitest/coverage-v8": "^4.1.6",
114
- "eslint": "^10.4.0",
91
+ "eslint": "^10.6.0",
115
92
  "eslint-plugin-react-hooks": "^7.1.1",
116
- "eslint-plugin-react-refresh": "^0.5.2",
117
- "eslint-plugin-storybook": "^10.4.2",
118
- "globals": "^17.6.0",
119
- "motely-wasm": "^22.0.0",
120
- "playwright": "^1.60.0",
121
- "react": "^19.2.6",
122
- "react-dom": "^19.2.6",
123
- "react-icons": "^5.6.0",
124
- "storybook": "^10.4.0",
93
+ "eslint-plugin-react-refresh": "^0.5.3",
94
+ "globals": "^17.7.0",
95
+ "motely-wasm": "^23.3.0",
96
+ "react": "^19.2.7",
97
+ "react-dom": "^19.2.7",
98
+ "storybook": "^10.4.6",
125
99
  "typescript": "^5.9.3",
126
- "typescript-eslint": "^8.59.3",
127
- "vite": "^8.0.13",
128
- "vite-plugin-dts": "^5.0.0",
129
- "vitest": "^4.1.6"
130
- },
131
- "dependencies": {
132
- "@codemirror/autocomplete": "^6.20.3",
133
- "@codemirror/commands": "^6.10.3",
134
- "@codemirror/lang-javascript": "^6.2.5",
135
- "@codemirror/lang-yaml": "^6.1.3",
136
- "@codemirror/language": "^6.12.3",
137
- "@codemirror/lint": "^6.9.6",
138
- "@codemirror/state": "^6.6.0",
139
- "@codemirror/view": "^6.43.0",
140
- "@lezer/highlight": "^1.2.3",
141
- "@react-spring/three": "^10.1.0",
142
- "@react-three/drei": "^10.7.7",
143
- "@react-three/fiber": "^9.6.1",
144
- "@types/js-yaml": "^4.0.9",
145
- "jaml-lang": "^1.0.0",
146
- "js-yaml": "^4.1.1",
147
- "lucide-react": "^1.16.0",
148
- "three": "^0.184.0",
149
- "zustand": "^5.0.13"
100
+ "typescript-eslint": "^8.62.0",
101
+ "vite": "^6.0.0",
102
+ "vite-plugin-dts": "^5.0.3",
103
+ "eslint-plugin-storybook": "10.4.6",
104
+ "@storybook/addon-docs": "^10.4.6"
150
105
  }
151
106
  }
@@ -1,2 +0,0 @@
1
- import{Program as e}from"motely-wasm/motely/wasm";import t from"motely-wasm";import{IFileMounter as n}from"motely-wasm/bootsharp/file-system";let r=()=>!0;e.jimmolatePredicate=e=>r(e);function i(e){r=e}function a(){r=()=>!0}let o=null;async function s(){if(o)return o;if(t.getStatus()===t.BootStatus.Standby)return o=(async()=>{try{(await import(`@rewaffle/bootsharp-file-system`)).init(n)}catch{}await t.boot()})(),o}const c=globalThis;let l=null,u=[],d=0;function f(){for(let e of u)e();u=[]}function p(){f();let t=e=>{c.postMessage({type:`result`,workerIndex:d,seed:e.seed,score:e.score,tallyColumns:Array.from(e.tallies)})};e.onScoredResult.subscribe(t),u.push(()=>e.onScoredResult.unsubscribe(t));let n=e=>{c.postMessage({type:`progress`,workerIndex:d,searched:Number(e.seedsSearched),matching:Number(e.matchingSeeds),percent:e.percentComplete,seedsPerMs:e.seedsPerMillisecond})};e.onProgress.subscribe(n),u.push(()=>e.onProgress.unsubscribe(n));let r=e=>{c.postMessage({type:`match`,workerIndex:d,seed:e})};e.onSeedMatch.subscribe(r),u.push(()=>e.onSeedMatch.unsubscribe(r))}function m(e,t){return typeof t.deck==`number`&&(e.deck=t.deck),typeof t.stake==`number`&&(e.stake=t.stake),e}function h(t){let n=m(e.fromYaml(t.jaml),t);switch(t.mode){case`aesthetic`:return e.runAestheticSearch(n,t.aesthetic??0);case`seedlist`:return n.seeds=t.seeds??[],e.runSeedListSearch(n);case`random`:{let r=typeof t.count==`number`&&t.count>0?t.count:0;return e.runRandomSearch(n,r)}case`sequential`:{let r=typeof t.startBatchIndex==`string`?BigInt(t.startBatchIndex):void 0,i=typeof t.endBatchIndex==`string`?BigInt(t.endBatchIndex):void 0,a=typeof t.batchCharacterCount==`number`?t.batchCharacterCount:void 0;return e.runSequentialSearch(n,r,i,a)}default:return e.runAestheticSearch(n,0)}}c.onmessage=async t=>{let n=t.data;if(n.type===`stop`){l?.cancel(),f(),c.postMessage({type:`cancelled`,workerIndex:d});return}if(n.type===`start`){d=n.workerIndex;try{await s();let t=!!n.predicateStr;if(n.predicateStr)try{let t=Function(`result`,`return (${n.predicateStr})(result);`);i(e=>t(e)),e.jimmolateEnabled=!0}catch(e){console.error(`Failed to compile worker Jimmolate predicate:`,e)}p();try{let e=h(n);l=e,c.postMessage({type:`complete`,workerIndex:d,status:e.isCompleted?`Completed`:`Cancelled`,total:Number(e.totalSeedsSearched),matched:Number(e.matchingSeeds)})}finally{t&&(e.jimmolateEnabled=!1,a()),f(),l=null}}catch(e){f(),l=null,c.postMessage({type:`error`,workerIndex:d,message:e instanceof Error?e.message:String(e)})}}},c.postMessage({type:`ready`});
2
- //# sourceMappingURL=searchPoolWorker-BdrYmnig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"searchPoolWorker-BdrYmnig.js","names":[],"sources":["../../src/lib/motely/runtime.ts","../../src/hooks/searchPoolWorker.ts"],"sourcesContent":["import bootsharp from \"motely-wasm\";\nimport { Program as Motely } from \"motely-wasm/motely/wasm\";\nimport type { MotelyScoredSeedResult } from \"motely-wasm/motely\";\nimport { IFileMounter } from \"motely-wasm/bootsharp/file-system\";\n\nexport type MotelyRuntimeStatus = \"idle\" | \"booting\" | \"ready\" | \"error\";\n\n// Jimmolate probe dispatcher.\n//\n// Bootsharp snapshots [Import] bindings at boot() — assigning\n// `Motely.jimmolatePredicate` AFTER boot is a silent no-op, so we bind a STABLE\n// dispatcher here at module load (always before any ensureMotelyReady()/boot()\n// call) and swap the inner predicate per search via setJimmolateProbe().\n// `Motely.jimmolateEnabled` is a plain settable, fine to flip after boot.\n//\n// motely-wasm 21.1 reshaped the probe: it now receives the scored result\n// ({seed, score, tallies}) instead of a search context.\nexport type JimmolateProbe = (result: MotelyScoredSeedResult) => boolean;\nlet currentProbe: JimmolateProbe = () => true;\nMotely.jimmolatePredicate = (result: MotelyScoredSeedResult) => currentProbe(result);\n\n/** Swap the active Jimmolate predicate. Safe before or after boot. */\nexport function setJimmolateProbe(pred: JimmolateProbe): void {\n currentProbe = pred;\n}\n\n/** Reset the probe to pass-through (the engine's default: every survivor matches). */\nexport function clearJimmolateProbe(): void {\n currentProbe = () => true;\n}\n\n// Must match the path the host serves motely-wasm's bin/ at.\n// Used by main-thread hooks, workers, and Storybook staticDir alike.\n// The Storybook staticDir in .storybook/main.ts serves it here.\n// Next.js consumers must serve it at this path too (e.g. via a catch-all route).\n// A bare \"/bin\" would 404 in every deployment context.\nexport const MOTELY_BIN_PATH = \"/motely-wasm/bin\";\n\n// File System extension (optional peer `@rewaffle/bootsharp-file-system`).\n//\n// fs.init() binds the IFileMounter [Import], which — like the Jimmolate probe\n// above and EVERY Bootsharp [Import] — must be assigned BEFORE boot()\n// (Bootsharp docs: extensions/file-system). The package is an OPTIONAL peer, so\n// we dynamically import it and swallow its absence: consumers without it simply\n// get no library mount (useJamlLibrary reports status \"unsupported\").\n//\n// This MUST live in the one centralized boot path, not in a component effect.\n// ~8 callers (useSearch, the workers, useAnalyzer, Jamlyzer, …) each trigger\n// boot via ensureMotelyReady(); whichever fires first wins. If fs.init() sat in\n// useJamlLibrary's useEffect it would lose that race and the mounter would never\n// be bound pre-boot — which is exactly why the library mount silently failed.\nlet fileSystemReady = false;\nlet fileSystemError: unknown = null;\n\n/** True once the optional File System extension was bound before boot. */\nexport function isFileSystemReady(): boolean {\n return fileSystemReady;\n}\n\n/** The error from a failed or absent File System init, if any. */\nexport function getFileSystemError(): unknown {\n return fileSystemError;\n}\n\n// Single boot promise: fs.init() (pre-boot) → boot(), run exactly once and\n// awaited by every caller, so the ordering holds no matter who boots first.\nlet bootPromise: Promise<void> | null = null;\n\nexport async function ensureMotelyReady(): Promise<void> {\n if (bootPromise) return bootPromise;\n if (bootsharp.getStatus() !== bootsharp.BootStatus.Standby) return;\n bootPromise = (async () => {\n // Pre-boot: bind the optional File System mounter if it's installed.\n try {\n // @vite-ignore — optional peer; may be absent on disk. Keep it a\n // runtime import() so Vite's dev import-analysis (Storybook, demo)\n // doesn't try to resolve it at transform time and hard-fail. When\n // missing it throws here and is swallowed → status \"unsupported\".\n // (The library build externalizes it via PEER_EXTERNALS regardless.)\n const fs = await import(/* @vite-ignore */ \"@rewaffle/bootsharp-file-system\");\n fs.init(IFileMounter);\n fileSystemReady = true;\n } catch (error) {\n fileSystemError = error;\n }\n // motely-wasm is an EMBEDDED build (the runtime is inlined into the JS as\n // base64 — see dist/generated/resources.g.mjs), so boot() takes no args and\n // needs no served binaries. The old boot(\"/motely-wasm/bin\") was leftover\n // sideloaded config and 404'd in every context.\n await bootsharp.boot();\n })();\n return bootPromise;\n}\n","/// <reference lib=\"webworker\" />\n\n// Pool worker. Each instance boots its own motely-wasm runtime (single-threaded\n// per Bootsharp 0.8 post-#203 — no SAB, no COOP/COEP). The owning `useSearchPool`\n// hook is responsible for partitioning the input space and assigning each worker\n// a disjoint slice via the fields on PoolStartMessage. This worker just runs\n// what it is told.\nimport { Program as Motely } from \"motely-wasm/motely/wasm\";\nimport type { IMotelySearch, MotelyProgress, MotelyScoredSeedResult } from \"motely-wasm/motely\";\nimport type { MotelyDeck, MotelyStake } from \"motely-wasm/motely/enums\";\nimport type { JamlAesthetic, JamlConfig } from \"motely-wasm/motely/filters/jaml\";\nimport { ensureMotelyReady, setJimmolateProbe, clearJimmolateProbe } from \"../lib/motely/runtime.js\";\n\nconst self = globalThis as typeof globalThis & DedicatedWorkerGlobalScope;\n\nexport type PoolSearchMode = \"random\" | \"seedlist\" | \"sequential\" | \"aesthetic\";\n\nexport interface PoolStartMessage {\n type: \"start\";\n workerIndex: number;\n workerCount: number;\n mode: PoolSearchMode;\n jaml: string;\n count?: number;\n seeds?: string[];\n batchCharacterCount?: number;\n startBatchIndex?: string;\n endBatchIndex?: string;\n aesthetic?: number;\n deck?: number;\n stake?: number;\n predicateStr?: string;\n}\n\nexport interface PoolStopMessage {\n type: \"stop\";\n}\n\nexport type PoolInboundMessage = PoolStartMessage | PoolStopMessage;\n\nexport interface PoolReadyMessage {\n type: \"ready\";\n}\n\nexport interface PoolResultMessage {\n type: \"result\";\n workerIndex: number;\n seed: string;\n score: number;\n tallyColumns: number[];\n}\n\nexport interface PoolMatchMessage {\n type: \"match\";\n workerIndex: number;\n seed: string;\n}\n\nexport interface PoolProgressMessage {\n type: \"progress\";\n workerIndex: number;\n searched: number;\n matching: number;\n percent: number;\n seedsPerMs: number;\n}\n\nexport interface PoolCompleteMessage {\n type: \"complete\";\n workerIndex: number;\n status: \"Completed\" | \"Cancelled\";\n total: number;\n matched: number;\n}\n\nexport interface PoolCancelledMessage {\n type: \"cancelled\";\n workerIndex: number;\n}\n\nexport interface PoolErrorMessage {\n type: \"error\";\n workerIndex: number;\n message: string;\n}\n\nexport type PoolOutboundMessage =\n | PoolReadyMessage\n | PoolResultMessage\n | PoolMatchMessage\n | PoolProgressMessage\n | PoolCompleteMessage\n | PoolCancelledMessage\n | PoolErrorMessage;\n\nlet currentSearch: IMotelySearch | null = null;\nlet unsubscribers: Array<() => void> = [];\nlet workerIndex = 0;\n\nfunction detachListeners(): void {\n for (const off of unsubscribers) off();\n unsubscribers = [];\n}\n\nfunction attachListeners(): void {\n detachListeners();\n\n const onResult = (result: MotelyScoredSeedResult) => {\n self.postMessage({\n type: \"result\",\n workerIndex,\n seed: result.seed,\n score: result.score,\n tallyColumns: Array.from(result.tallies),\n } satisfies PoolResultMessage);\n };\n Motely.onScoredResult.subscribe(onResult);\n unsubscribers.push(() => Motely.onScoredResult.unsubscribe(onResult));\n\n const onProgress = (progress: MotelyProgress) => {\n self.postMessage({\n type: \"progress\",\n workerIndex,\n searched: Number(progress.seedsSearched),\n matching: Number(progress.matchingSeeds),\n percent: progress.percentComplete,\n seedsPerMs: progress.seedsPerMillisecond,\n } satisfies PoolProgressMessage);\n };\n Motely.onProgress.subscribe(onProgress);\n unsubscribers.push(() => Motely.onProgress.unsubscribe(onProgress));\n\n const onSeedMatch = (seed: string) => {\n self.postMessage({\n type: \"match\",\n workerIndex,\n seed,\n } satisfies PoolMatchMessage);\n };\n Motely.onSeedMatch.subscribe(onSeedMatch);\n unsubscribers.push(() => Motely.onSeedMatch.unsubscribe(onSeedMatch));\n}\n\n// deck/stake are config fields now; the worker is single-threaded, so the old\n// withThreadCount(1) is dropped (it was a no-op here).\nfunction applyCommonOverrides(config: JamlConfig, message: PoolStartMessage): JamlConfig {\n if (typeof message.deck === \"number\") {\n config.deck = message.deck as MotelyDeck;\n }\n if (typeof message.stake === \"number\") {\n config.stake = message.stake as MotelyStake;\n }\n return config;\n}\n\n// motely-wasm 21: Program.run*Search executes synchronously to completion and\n// returns the finished IMotelySearch — this RUNS the search, not just configures.\nfunction runConfigured(message: PoolStartMessage): IMotelySearch {\n const config = applyCommonOverrides(Motely.fromYaml(message.jaml), message);\n\n switch (message.mode) {\n case \"aesthetic\":\n return Motely.runAestheticSearch(config, (message.aesthetic ?? 0) as JamlAesthetic);\n case \"seedlist\": {\n config.seeds = message.seeds ?? [];\n return Motely.runSeedListSearch(config);\n }\n case \"random\": {\n const count = typeof message.count === \"number\" && message.count > 0 ? message.count : 0;\n return Motely.runRandomSearch(config, count);\n }\n case \"sequential\": {\n const start = typeof message.startBatchIndex === \"string\" ? BigInt(message.startBatchIndex) : undefined;\n const end = typeof message.endBatchIndex === \"string\" ? BigInt(message.endBatchIndex) : undefined;\n const batchChars = typeof message.batchCharacterCount === \"number\" ? message.batchCharacterCount : undefined;\n return Motely.runSequentialSearch(config, start, end, batchChars);\n }\n default:\n return Motely.runAestheticSearch(config, 0 as JamlAesthetic);\n }\n}\n\nself.onmessage = async (event: MessageEvent) => {\n const data = event.data as PoolInboundMessage;\n\n if (data.type === \"stop\") {\n currentSearch?.cancel();\n detachListeners();\n self.postMessage({ type: \"cancelled\", workerIndex } satisfies PoolCancelledMessage);\n return;\n }\n\n if (data.type !== \"start\") return;\n\n workerIndex = data.workerIndex;\n\n try {\n await ensureMotelyReady();\n\n // motely-wasm 21.1 jimmolate shape: predicate receives the scored\n // result ({seed, score, tallies}), not (seed, deck, stake).\n const useJimmolate = Boolean(data.predicateStr);\n if (data.predicateStr) {\n try {\n const pred = new Function(\"result\", `return (${data.predicateStr})(result);`) as (result: MotelyScoredSeedResult) => boolean;\n setJimmolateProbe((result) => pred(result));\n Motely.jimmolateEnabled = true;\n } catch (err) {\n console.error(\"Failed to compile worker Jimmolate predicate:\", err);\n }\n }\n\n attachListeners();\n\n try {\n const search = runConfigured(data);\n currentSearch = search;\n self.postMessage({\n type: \"complete\",\n workerIndex,\n status: search.isCompleted ? \"Completed\" : \"Cancelled\",\n total: Number(search.totalSeedsSearched),\n matched: Number(search.matchingSeeds),\n } satisfies PoolCompleteMessage);\n } finally {\n if (useJimmolate) {\n Motely.jimmolateEnabled = false;\n clearJimmolateProbe();\n }\n detachListeners();\n currentSearch = null;\n }\n } catch (error) {\n detachListeners();\n currentSearch = null;\n self.postMessage({\n type: \"error\",\n workerIndex,\n message: error instanceof Error ? error.message : String(error),\n } satisfies PoolErrorMessage);\n }\n};\n\nself.postMessage({ type: \"ready\" } satisfies PoolReadyMessage);\n"],"mappings":"8IAkBA,IAAI,MAAqC,GACzC,EAAO,mBAAsB,GAAmC,EAAa,CAAM,EAGnF,SAAgB,EAAkB,EAA4B,CAC1D,EAAe,CACnB,CAGA,SAAgB,GAA4B,CACxC,MAAqB,EACzB,CAsBA,IAeI,EAAoC,KAExC,eAAsB,GAAmC,CACrD,GAAI,EAAa,OAAO,EACpB,KAAU,UAAU,IAAM,EAAU,WAAW,QAqBnD,MApBA,IAAe,SAAY,CAEvB,GAAI,EAOA,MADiB,OAA0B,oCACxC,KAAK,CAAY,CAExB,MAAgB,CAEhB,CAKA,MAAM,EAAU,KAAK,CACzB,GAAG,EACI,CACX,CC/EA,MAAM,EAAO,WAkFb,IAAI,EAAsC,KACtC,EAAmC,CAAC,EACpC,EAAc,EAElB,SAAS,GAAwB,CAC7B,IAAK,IAAM,KAAO,EAAe,EAAI,EACrC,EAAgB,CAAC,CACrB,CAEA,SAAS,GAAwB,CAC7B,EAAgB,EAEhB,IAAM,EAAY,GAAmC,CACjD,EAAK,YAAY,CACb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,KAAM,OAAQ,CAA4B"}
@@ -1,66 +0,0 @@
1
- //#region src/render/Layer.ts
2
- var e = class {
3
- pos;
4
- name;
5
- order;
6
- source;
7
- rows;
8
- columns;
9
- animated;
10
- constructor({ pos: e, name: t, order: n, source: r, rows: i, columns: a, animated: o = !1 }) {
11
- this.pos = e, this.name = t, this.order = n, this.source = r, this.rows = i, this.columns = a, this.animated = o;
12
- }
13
- };
14
- //#endregion
15
- //#region src/lib/jaml/jamlSeeds.ts
16
- function t(e) {
17
- let t = e.split(/\r?\n/), n = [], r = !1;
18
- for (let e of t) {
19
- if (/^seeds:\s*$/.test(e)) {
20
- r = !0;
21
- continue;
22
- }
23
- if (!r) continue;
24
- let t = e.match(/^\s+-\s+(\S+)\s*$/);
25
- if (t) {
26
- n.push(t[1]);
27
- continue;
28
- }
29
- if (e.trim() !== "") break;
30
- }
31
- return n;
32
- }
33
- function n(e) {
34
- return e.length === 0 ? ["seeds:"] : ["seeds:", ...e.map((e) => ` - ${e}`)];
35
- }
36
- function r(e, t, r = 1e3) {
37
- let i = n([...new Set(t.map((e) => e.trim()).filter(Boolean))].slice(0, r)), a = e.split(/\r?\n/), o = a.findIndex((e) => /^seeds:\s*$/.test(e));
38
- if (o >= 0) {
39
- let e = o + 1;
40
- for (; e < a.length;) {
41
- let t = a[e];
42
- if (/^\s+-\s+\S+/.test(t)) {
43
- e += 1;
44
- continue;
45
- }
46
- if (t.trim() === "") {
47
- e += 1;
48
- continue;
49
- }
50
- break;
51
- }
52
- let t = a.slice(0, o);
53
- for (; t.length > 0 && t[t.length - 1].trim() === "";) t.pop();
54
- let n = a.slice(e);
55
- return [
56
- ...t,
57
- ...i,
58
- ...n
59
- ].join("\n").replace(/\n+$/, "") + "\n";
60
- }
61
- return `${e.replace(/\n+$/, "")}\n${i.join("\n")}\n`;
62
- }
63
- //#endregion
64
- export { t as n, e as r, r as t };
65
-
66
- //# sourceMappingURL=jamlSeeds-CKHvpjhC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jamlSeeds-CKHvpjhC.js","names":[],"sources":["../../src/render/Layer.ts","../../src/lib/jaml/jamlSeeds.ts"],"sourcesContent":["/**\n * Layer class for sprite-based card rendering.\n * Encapsulates the source, position, and dimensions of a sprite layer.\n */\nexport interface LayerOptions {\n pos: { x: number; y: number };\n name: string;\n order: number;\n source: string;\n rows: number;\n columns: number;\n animated?: boolean;\n}\n\nexport class Layer {\n pos: { x: number; y: number };\n name: string;\n order: number;\n source: string;\n rows: number;\n columns: number;\n animated: boolean;\n\n constructor({ pos, name, order, source, rows, columns, animated = false }: LayerOptions) {\n this.pos = pos;\n this.name = name;\n this.order = order;\n this.source = source;\n this.rows = rows;\n this.columns = columns;\n this.animated = animated;\n }\n}\n","/** Read top-level `seeds:` entries from a JAML document. */\nexport function parseJamlSeeds(jaml: string): string[] {\n const lines = jaml.split(/\\r?\\n/);\n const seeds: string[] = [];\n let inSeeds = false;\n\n for (const line of lines) {\n if (/^seeds:\\s*$/.test(line)) {\n inSeeds = true;\n continue;\n }\n if (!inSeeds) continue;\n\n const item = line.match(/^\\s+-\\s+(\\S+)\\s*$/);\n if (item) {\n seeds.push(item[1]);\n continue;\n }\n if (line.trim() === \"\") continue;\n break;\n }\n\n return seeds;\n}\n\nfunction formatSeedsBlock(seeds: string[]): string[] {\n if (seeds.length === 0) return [\"seeds:\"];\n return [\"seeds:\", ...seeds.map((seed) => ` - ${seed}`)];\n}\n\n/**\n * Write seeds into JAML the same way Motely CLI `--save-seeds` does:\n * replace the top-level `seeds:` block (or append one if missing).\n */\nexport function mergeSeedsIntoJaml(jaml: string, seeds: string[], max = 1000): string {\n const capped = [...new Set(seeds.map((s) => s.trim()).filter(Boolean))].slice(0, max);\n const block = formatSeedsBlock(capped);\n const lines = jaml.split(/\\r?\\n/);\n const seedsLineIdx = lines.findIndex((line) => /^seeds:\\s*$/.test(line));\n\n if (seedsLineIdx >= 0) {\n let end = seedsLineIdx + 1;\n while (end < lines.length) {\n const line = lines[end];\n if (/^\\s+-\\s+\\S+/.test(line)) {\n end += 1;\n continue;\n }\n if (line.trim() === \"\") {\n end += 1;\n continue;\n }\n break;\n }\n\n const before = lines.slice(0, seedsLineIdx);\n while (before.length > 0 && before[before.length - 1].trim() === \"\") {\n before.pop();\n }\n const after = lines.slice(end);\n return [...before, ...block, ...after].join(\"\\n\").replace(/\\n+$/, \"\") + \"\\n\";\n }\n\n const trimmed = jaml.replace(/\\n+$/, \"\");\n return `${trimmed}\\n${block.join(\"\\n\")}\\n`;\n}\n"],"mappings":";AAcA,IAAa,IAAb,MAAmB;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,EAAE,QAAK,SAAM,UAAO,WAAQ,SAAM,YAAS,cAAW,MAAuB;EAOrF,AANA,KAAK,MAAM,GACX,KAAK,OAAO,GACZ,KAAK,QAAQ,GACb,KAAK,SAAS,GACd,KAAK,OAAO,GACZ,KAAK,UAAU,GACf,KAAK,WAAW;CACpB;AACJ;;;AC/BA,SAAgB,EAAe,GAAwB;CACrD,IAAM,IAAQ,EAAK,MAAM,OAAO,GAC1B,IAAkB,CAAC,GACrB,IAAU;CAEd,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAI,cAAc,KAAK,CAAI,GAAG;GAC5B,IAAU;GACV;EACF;EACA,IAAI,CAAC,GAAS;EAEd,IAAM,IAAO,EAAK,MAAM,mBAAmB;EAC3C,IAAI,GAAM;GACR,EAAM,KAAK,EAAK,EAAE;GAClB;EACF;EACI,MAAK,KAAK,MAAM,IACpB;CACF;CAEA,OAAO;AACT;AAEA,SAAS,EAAiB,GAA2B;CAEnD,OADI,EAAM,WAAW,IAAU,CAAC,QAAQ,IACjC,CAAC,UAAU,GAAG,EAAM,KAAK,MAAS,OAAO,GAAM,CAAC;AACzD;AAMA,SAAgB,EAAmB,GAAc,GAAiB,IAAM,KAAc;CAEpF,IAAM,IAAQ,EADC,CAAC,GAAG,IAAI,IAAI,EAAM,KAAK,MAAM,EAAE,KAAK,CAAC,EAAE,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