@asymmetric-effort/specifyjs 0.2.169 → 0.2.171

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.
@@ -1995,7 +1995,7 @@ function ColorPicker(props) {
1995
1995
  alignItems: "center",
1996
1996
  gap: "8px"
1997
1997
  };
1998
- const dropdownStyle = {
1998
+ const dropdownStyle2 = {
1999
1999
  position: "absolute",
2000
2000
  top: "100%",
2001
2001
  left: "0",
@@ -2082,7 +2082,7 @@ function ColorPicker(props) {
2082
2082
  ) : null;
2083
2083
  const dropdown = isOpen ? createElement(
2084
2084
  "div",
2085
- { style: dropdownStyle },
2085
+ { style: dropdownStyle2 },
2086
2086
  createElement("div", { style: swatchGridStyle }, ...swatches),
2087
2087
  hexInput
2088
2088
  ) : null;
@@ -2329,7 +2329,7 @@ function DatePicker(props) {
2329
2329
  minHeight: "38px",
2330
2330
  userSelect: "none"
2331
2331
  };
2332
- const dropdownStyle = {
2332
+ const dropdownStyle2 = {
2333
2333
  position: "absolute",
2334
2334
  top: "100%",
2335
2335
  left: "0",
@@ -2418,7 +2418,7 @@ function DatePicker(props) {
2418
2418
  });
2419
2419
  const calendar = isOpen ? createElement(
2420
2420
  "div",
2421
- { style: dropdownStyle },
2421
+ { style: dropdownStyle2 },
2422
2422
  // Nav
2423
2423
  createElement(
2424
2424
  "div",
@@ -2635,7 +2635,7 @@ function FileUpload(props) {
2635
2635
  "div",
2636
2636
  { style: { marginTop: "8px", display: "flex", flexDirection: "column", gap: "4px" } },
2637
2637
  ...files.map((file, idx) => {
2638
- const fileItemStyle = {
2638
+ const fileItemStyle2 = {
2639
2639
  display: "flex",
2640
2640
  alignItems: "center",
2641
2641
  justifyContent: "space-between",
@@ -2656,7 +2656,7 @@ function FileUpload(props) {
2656
2656
  };
2657
2657
  return createElement(
2658
2658
  "div",
2659
- { key: `file-${idx}`, style: fileItemStyle },
2659
+ { key: `file-${idx}`, style: fileItemStyle2 },
2660
2660
  createElement(
2661
2661
  "div",
2662
2662
  { style: { display: "flex", alignItems: "center", gap: "8px", overflow: "hidden" } },
@@ -3192,7 +3192,7 @@ function Select(props) {
3192
3192
  minHeight: "38px",
3193
3193
  userSelect: "none"
3194
3194
  };
3195
- const dropdownStyle = {
3195
+ const dropdownStyle2 = {
3196
3196
  position: "absolute",
3197
3197
  top: "100%",
3198
3198
  left: "0",
@@ -3352,7 +3352,7 @@ function Select(props) {
3352
3352
  }) : null;
3353
3353
  const dropdown = isOpen ? createElement(
3354
3354
  "div",
3355
- { style: dropdownStyle, role: "listbox" },
3355
+ { style: dropdownStyle2, role: "listbox" },
3356
3356
  searchInput,
3357
3357
  ...renderOptions()
3358
3358
  ) : null;
@@ -14607,7 +14607,7 @@ function WordProcessor(props) {
14607
14607
  backgroundColor: "#f0f0f0",
14608
14608
  overflow: "hidden"
14609
14609
  }), []);
14610
- const menuBarStyle = {
14610
+ const menuBarStyle2 = {
14611
14611
  display: "flex",
14612
14612
  alignItems: "center",
14613
14613
  height: "30px",
@@ -14660,7 +14660,7 @@ function WordProcessor(props) {
14660
14660
  cursor: "text",
14661
14661
  outline: "none"
14662
14662
  };
14663
- const statusBarStyle = {
14663
+ const statusBarStyle2 = {
14664
14664
  height: "24px",
14665
14665
  backgroundColor: "var(--color-bg-subtle, #f0f0f0)",
14666
14666
  borderTop: "1px solid var(--color-border, #ccc)",
@@ -14692,7 +14692,7 @@ function WordProcessor(props) {
14692
14692
  position: "relative"
14693
14693
  };
14694
14694
  }
14695
- const dropdownStyle = {
14695
+ const dropdownStyle2 = {
14696
14696
  position: "absolute",
14697
14697
  top: "100%",
14698
14698
  left: "0",
@@ -14704,7 +14704,7 @@ function WordProcessor(props) {
14704
14704
  padding: "4px 0",
14705
14705
  zIndex: "1000"
14706
14706
  };
14707
- const dropdownItemStyle = {
14707
+ const dropdownItemStyle2 = {
14708
14708
  display: "block",
14709
14709
  width: "100%",
14710
14710
  padding: "6px 16px",
@@ -14767,7 +14767,7 @@ function WordProcessor(props) {
14767
14767
  "div",
14768
14768
  {
14769
14769
  key: "dropdown",
14770
- style: dropdownStyle,
14770
+ style: dropdownStyle2,
14771
14771
  className: "word-processor__menu-dropdown"
14772
14772
  },
14773
14773
  ...MENU_ITEMS[menu].map(
@@ -14775,7 +14775,7 @@ function WordProcessor(props) {
14775
14775
  "button",
14776
14776
  {
14777
14777
  key: String(j),
14778
- style: dropdownItemStyle,
14778
+ style: dropdownItemStyle2,
14779
14779
  onClick: (e) => {
14780
14780
  e.stopPropagation();
14781
14781
  handleMenuAction(item.action);
@@ -14813,7 +14813,7 @@ function WordProcessor(props) {
14813
14813
  // Menu Bar
14814
14814
  createElement(
14815
14815
  "div",
14816
- { className: "word-processor__menu-bar", style: menuBarStyle, role: "menubar" },
14816
+ { className: "word-processor__menu-bar", style: menuBarStyle2, role: "menubar" },
14817
14817
  ...menuElements
14818
14818
  ),
14819
14819
  // Toolbar
@@ -14927,34 +14927,572 @@ function WordProcessor(props) {
14927
14927
  { className: "word-processor__ruler", style: rulerStyle, "aria-hidden": "true" },
14928
14928
  ...rulerTicks
14929
14929
  ),
14930
- // Document Area
14930
+ // Document Area
14931
+ createElement(
14932
+ "main",
14933
+ {
14934
+ className: "word-processor__document-area",
14935
+ style: documentAreaStyle,
14936
+ onClick: handleDocumentAreaClick
14937
+ },
14938
+ createElement(
14939
+ "div",
14940
+ {
14941
+ className: "word-processor__page",
14942
+ style: pageStyle,
14943
+ contentEditable: "true",
14944
+ ref: editorRef,
14945
+ onInput: handleInput,
14946
+ suppressContentEditableWarning: true
14947
+ },
14948
+ displayContent
14949
+ )
14950
+ ),
14951
+ // Status Bar
14952
+ createElement(
14953
+ "div",
14954
+ { className: "word-processor__status-bar", style: statusBarStyle2 },
14955
+ createElement("span", null, "Page 1 of 1"),
14956
+ createElement("span", null, `${displayWordCount} words`),
14957
+ createElement("span", null, "100%")
14958
+ )
14959
+ );
14960
+ }
14961
+
14962
+ // ../components/page/ide/src/TitleBar.ts
14963
+ function TitleBar(props) {
14964
+ const baseStyle = useMemo(() => ({
14965
+ height: "30px",
14966
+ backgroundColor: "#323233",
14967
+ display: "flex",
14968
+ alignItems: "center",
14969
+ justifyContent: "center",
14970
+ fontSize: "12px",
14971
+ color: "#999",
14972
+ flexShrink: "0",
14973
+ borderBottom: "1px solid var(--color-border, #252526)"
14974
+ }), []);
14975
+ const mergedStyle = props.style ? { ...baseStyle, ...props.style } : baseStyle;
14976
+ return createElement(
14977
+ "div",
14978
+ { className: "ide__title-bar", style: mergedStyle },
14979
+ props.title
14980
+ );
14981
+ }
14982
+
14983
+ // ../components/page/ide/src/MenuBar.ts
14984
+ var menuBarStyle = {
14985
+ height: "28px",
14986
+ backgroundColor: "#3c3c3c",
14987
+ display: "flex",
14988
+ alignItems: "center",
14989
+ padding: "0 8px",
14990
+ gap: "2px",
14991
+ flexShrink: "0",
14992
+ position: "relative"
14993
+ };
14994
+ var menuItemStyleBase = {
14995
+ padding: "3px 8px",
14996
+ fontSize: "12px",
14997
+ color: "#cccccc",
14998
+ cursor: "pointer",
14999
+ borderRadius: "3px",
15000
+ backgroundColor: "transparent",
15001
+ border: "none",
15002
+ position: "relative"
15003
+ };
15004
+ var menuItemStyleActive = {
15005
+ ...menuItemStyleBase,
15006
+ backgroundColor: "rgba(255,255,255,0.1)"
15007
+ };
15008
+ var dropdownStyle = {
15009
+ position: "absolute",
15010
+ top: "100%",
15011
+ left: "0",
15012
+ minWidth: "180px",
15013
+ backgroundColor: "#2d2d2d",
15014
+ border: "1px solid #454545",
15015
+ borderRadius: "4px",
15016
+ boxShadow: "0 4px 12px rgba(0,0,0,0.4)",
15017
+ padding: "4px 0",
15018
+ zIndex: "1000"
15019
+ };
15020
+ var dropdownItemStyle = {
15021
+ display: "block",
15022
+ width: "100%",
15023
+ padding: "6px 16px",
15024
+ fontSize: "12px",
15025
+ color: "#cccccc",
15026
+ backgroundColor: "transparent",
15027
+ border: "none",
15028
+ textAlign: "left",
15029
+ cursor: "pointer",
15030
+ transition: "background 0.1s"
15031
+ };
15032
+ function MenuBar(props) {
15033
+ const [activeMenu, setActiveMenu] = useState(-1);
15034
+ const handleMenuClick = useCallback((index) => {
15035
+ setActiveMenu((prev) => prev === index ? -1 : index);
15036
+ }, []);
15037
+ const handleAction = useCallback((action) => {
15038
+ props.onAction(action);
15039
+ setActiveMenu(-1);
15040
+ }, [props.onAction]);
15041
+ const menuElements = props.menus.map((menu, i) => {
15042
+ const children = [menu];
15043
+ const isActive = activeMenu === i;
15044
+ if (isActive && props.menuItems[menu]) {
15045
+ children.push(
15046
+ createElement(
15047
+ "div",
15048
+ {
15049
+ key: "dropdown",
15050
+ style: dropdownStyle,
15051
+ className: "ide__menu-dropdown"
15052
+ },
15053
+ ...props.menuItems[menu].map(
15054
+ (item, j) => createElement(
15055
+ "button",
15056
+ {
15057
+ key: String(j),
15058
+ style: dropdownItemStyle,
15059
+ onClick: (e) => {
15060
+ e.stopPropagation();
15061
+ handleAction(item.action);
15062
+ },
15063
+ role: "menuitem"
15064
+ },
15065
+ item.label
15066
+ )
15067
+ )
15068
+ )
15069
+ );
15070
+ }
15071
+ return createElement(
15072
+ "button",
15073
+ {
15074
+ key: String(i),
15075
+ style: isActive ? menuItemStyleActive : menuItemStyleBase,
15076
+ role: "menuitem",
15077
+ "aria-label": menu,
15078
+ onClick: () => handleMenuClick(i)
15079
+ },
15080
+ ...children
15081
+ );
15082
+ });
15083
+ return createElement(
15084
+ "div",
15085
+ { className: "ide__menu-bar", style: menuBarStyle, role: "menubar" },
15086
+ ...menuElements
15087
+ );
15088
+ }
15089
+
15090
+ // ../components/page/ide/src/FileExplorer.ts
15091
+ var sidebarStyle = {
15092
+ width: "220px",
15093
+ backgroundColor: "#252526",
15094
+ borderRight: "none",
15095
+ display: "flex",
15096
+ flexDirection: "column",
15097
+ flexShrink: "0",
15098
+ overflowY: "auto"
15099
+ };
15100
+ var sidebarHeaderStyle = {
15101
+ padding: "8px 12px",
15102
+ fontSize: "11px",
15103
+ fontWeight: "600",
15104
+ textTransform: "uppercase",
15105
+ letterSpacing: "0.5px",
15106
+ color: "#bbbbbb"
15107
+ };
15108
+ function fileItemStyle(indent, isFolder, isActive) {
15109
+ return {
15110
+ padding: "3px 8px",
15111
+ paddingLeft: `${12 + indent * 16}px`,
15112
+ fontSize: "13px",
15113
+ cursor: "pointer",
15114
+ color: isFolder ? "#cccccc" : "#d4d4d4",
15115
+ whiteSpace: "nowrap",
15116
+ overflow: "hidden",
15117
+ textOverflow: "ellipsis",
15118
+ borderRadius: "3px",
15119
+ margin: "0 4px",
15120
+ transition: "background-color 0.1s",
15121
+ backgroundColor: isActive ? "rgba(255,255,255,0.08)" : "transparent"
15122
+ };
15123
+ }
15124
+ function FileExplorer(props) {
15125
+ const isItemVisible = (item) => {
15126
+ if (!item.parent) return true;
15127
+ if (!props.expandedFolders[item.parent]) return false;
15128
+ const parentEntry = props.files.find((e) => e.name === item.parent && e.isFolder);
15129
+ if (parentEntry) return isItemVisible(parentEntry);
15130
+ return true;
15131
+ };
15132
+ const elements = props.files.map((item, i) => {
15133
+ if (!isItemVisible(item)) return null;
15134
+ const isActiveFile = !item.isFolder && item.name === props.activeFile;
15135
+ const folderIcon = item.isFolder ? props.expandedFolders[item.name] ? "\u{1F4C2} " : "\u{1F4C1} " : "\u{1F4C4} ";
15136
+ return createElement(
15137
+ "div",
15138
+ {
15139
+ key: String(i),
15140
+ style: fileItemStyle(item.indent, item.isFolder, isActiveFile),
15141
+ onClick: item.isFolder ? () => props.onFolderToggle(item.name) : () => props.onFileClick(item.name)
15142
+ },
15143
+ folderIcon,
15144
+ item.name
15145
+ );
15146
+ });
15147
+ const visibleElements = elements.filter((el) => el !== null);
15148
+ return createElement(
15149
+ "nav",
15150
+ { className: "ide__sidebar", style: sidebarStyle, "aria-label": "File explorer" },
15151
+ createElement("div", { style: sidebarHeaderStyle }, "Explorer"),
15152
+ ...visibleElements
15153
+ );
15154
+ }
15155
+
15156
+ // ../components/page/ide/src/TabBar.ts
15157
+ var tabBarStyle = {
15158
+ height: "35px",
15159
+ backgroundColor: "#252526",
15160
+ display: "flex",
15161
+ alignItems: "center",
15162
+ flexShrink: "0"
15163
+ };
15164
+ var activeTabStyle = {
15165
+ padding: "0 16px",
15166
+ height: "35px",
15167
+ lineHeight: "35px",
15168
+ backgroundColor: "#1e1e1e",
15169
+ color: "#ffffff",
15170
+ fontSize: "13px",
15171
+ cursor: "pointer",
15172
+ border: "none",
15173
+ borderBottom: "2px solid #007acc",
15174
+ boxSizing: "border-box"
15175
+ };
15176
+ var inactiveTabStyle = {
15177
+ padding: "0 16px",
15178
+ height: "35px",
15179
+ lineHeight: "35px",
15180
+ backgroundColor: "#2d2d2d",
15181
+ color: "#999999",
15182
+ fontSize: "13px",
15183
+ cursor: "pointer",
15184
+ border: "none",
15185
+ borderBottom: "2px solid transparent",
15186
+ boxSizing: "border-box"
15187
+ };
15188
+ function TabBar(props) {
15189
+ const tabElements = props.tabs.map((tab, i) => {
15190
+ const isActive = tab === props.activeTab;
15191
+ return createElement(
15192
+ "button",
15193
+ {
15194
+ key: String(i),
15195
+ style: isActive ? activeTabStyle : inactiveTabStyle,
15196
+ "aria-label": tab,
15197
+ onClick: () => props.onTabClick(tab)
15198
+ },
15199
+ tab
15200
+ );
15201
+ });
15202
+ return createElement(
15203
+ "div",
15204
+ { style: tabBarStyle },
15205
+ ...tabElements
15206
+ );
15207
+ }
15208
+
15209
+ // ../components/page/ide/src/SyntaxHighlighter.ts
15210
+ var COL_KEYWORD = "#569cd6";
15211
+ var COL_STRING = "#ce9178";
15212
+ var COL_TYPE = "#4ec9b0";
15213
+ var COL_COMMENT = "#6a9955";
15214
+ var COL_FUNCTION = "#dcdcaa";
15215
+ var COL_DEFAULT = "#d4d4d4";
15216
+ var COL_PUNCTUATION = "#d4d4d4";
15217
+ var COL_NUMBER = "#b5cea8";
15218
+ var KEYWORDS = /* @__PURE__ */ new Set([
15219
+ "import",
15220
+ "export",
15221
+ "from",
15222
+ "const",
15223
+ "let",
15224
+ "var",
15225
+ "function",
15226
+ "return",
15227
+ "if",
15228
+ "else",
15229
+ "for",
15230
+ "while",
15231
+ "class",
15232
+ "new",
15233
+ "throw",
15234
+ "try",
15235
+ "catch",
15236
+ "finally",
15237
+ "typeof",
15238
+ "instanceof",
15239
+ "in",
15240
+ "of",
15241
+ "default",
15242
+ "switch",
15243
+ "case",
15244
+ "break",
15245
+ "continue",
15246
+ "do",
15247
+ "void",
15248
+ "delete",
15249
+ "yield",
15250
+ "async",
15251
+ "await"
15252
+ ]);
15253
+ var TYPES = /* @__PURE__ */ new Set([
15254
+ "string",
15255
+ "number",
15256
+ "boolean",
15257
+ "void",
15258
+ "null",
15259
+ "undefined",
15260
+ "any",
15261
+ "never",
15262
+ "unknown",
15263
+ "object",
15264
+ "interface",
15265
+ "type",
15266
+ "enum"
15267
+ ]);
15268
+ function tokenizeLine(line) {
15269
+ if (!line.trim()) return [{ text: "\xA0", color: COL_DEFAULT }];
15270
+ const tokens = [];
15271
+ let i = 0;
15272
+ while (i < line.length) {
15273
+ if (line[i] === "/" && line[i + 1] === "/") {
15274
+ tokens.push({ text: line.slice(i), color: COL_COMMENT });
15275
+ break;
15276
+ }
15277
+ if (line[i] === '"' || line[i] === "'" || line[i] === "`") {
15278
+ const quote = line[i];
15279
+ let j = i + 1;
15280
+ while (j < line.length && line[j] !== quote) {
15281
+ if (line[j] === "\\") j++;
15282
+ j++;
15283
+ }
15284
+ j = Math.min(j + 1, line.length);
15285
+ tokens.push({ text: line.slice(i, j), color: COL_STRING });
15286
+ i = j;
15287
+ continue;
15288
+ }
15289
+ if (/[0-9]/.test(line[i]) && (i === 0 || /[\s(,=:[\]{}+\-*/]/.test(line[i - 1]))) {
15290
+ let j = i;
15291
+ while (j < line.length && /[0-9.]/.test(line[j])) j++;
15292
+ tokens.push({ text: line.slice(i, j), color: COL_NUMBER });
15293
+ i = j;
15294
+ continue;
15295
+ }
15296
+ if (/[a-zA-Z_$]/.test(line[i])) {
15297
+ let j = i;
15298
+ while (j < line.length && /[a-zA-Z0-9_$]/.test(line[j])) j++;
15299
+ const word = line.slice(i, j);
15300
+ let nextNonSpace = j;
15301
+ while (nextNonSpace < line.length && line[nextNonSpace] === " ") nextNonSpace++;
15302
+ const isCall = nextNonSpace < line.length && line[nextNonSpace] === "(";
15303
+ let color = COL_DEFAULT;
15304
+ if (KEYWORDS.has(word)) {
15305
+ color = COL_KEYWORD;
15306
+ } else if (TYPES.has(word)) {
15307
+ color = COL_TYPE;
15308
+ } else if (isCall) {
15309
+ color = COL_FUNCTION;
15310
+ } else if (word === "true" || word === "false") {
15311
+ color = COL_KEYWORD;
15312
+ }
15313
+ tokens.push({ text: word, color });
15314
+ i = j;
15315
+ continue;
15316
+ }
15317
+ if (line[i] === " " || line[i] === " ") {
15318
+ let j = i;
15319
+ while (j < line.length && (line[j] === " " || line[j] === " ")) j++;
15320
+ tokens.push({ text: line.slice(i, j), color: COL_DEFAULT });
15321
+ i = j;
15322
+ continue;
15323
+ }
15324
+ tokens.push({ text: line[i], color: COL_PUNCTUATION });
15325
+ i++;
15326
+ }
15327
+ return tokens;
15328
+ }
15329
+
15330
+ // ../components/page/ide/src/CodeEditor.ts
15331
+ var editorContentStyle = {
15332
+ flex: "1",
15333
+ display: "flex",
15334
+ overflow: "auto",
15335
+ backgroundColor: "#1e1e1e",
15336
+ fontFamily: '"Cascadia Code", "Fira Code", "Consolas", monospace',
15337
+ fontSize: "13px",
15338
+ lineHeight: "20px"
15339
+ };
15340
+ var lineNumbersStyle = {
15341
+ padding: "8px 0",
15342
+ textAlign: "right",
15343
+ color: "#858585",
15344
+ userSelect: "none",
15345
+ minWidth: "48px",
15346
+ paddingRight: "12px",
15347
+ paddingLeft: "12px",
15348
+ flexShrink: "0"
15349
+ };
15350
+ var codeAreaStyle = {
15351
+ padding: "8px 0",
15352
+ flex: "1",
15353
+ whiteSpace: "pre",
15354
+ overflowX: "auto",
15355
+ outline: "none",
15356
+ color: "#d4d4d4"
15357
+ };
15358
+ function CodeEditor(props) {
15359
+ const codeLines = props.content.map((line, i) => {
15360
+ const tokens = tokenizeLine(line);
15361
+ const spans = [];
15362
+ let spanIdx = 0;
15363
+ for (const token of tokens) {
15364
+ spans.push(
15365
+ createElement("span", {
15366
+ key: String(spanIdx++),
15367
+ style: { color: token.color }
15368
+ }, token.text)
15369
+ );
15370
+ }
15371
+ return createElement(
15372
+ "div",
15373
+ {
15374
+ key: String(i),
15375
+ style: { minHeight: "20px" }
15376
+ },
15377
+ ...spans
15378
+ );
15379
+ });
15380
+ const lineNumbers = [];
15381
+ for (let i = 0; i < props.content.length; i++) {
15382
+ lineNumbers.push(createElement("div", {
15383
+ key: String(i)
15384
+ }, String(i + 1)));
15385
+ }
15386
+ return createElement(
15387
+ "div",
15388
+ { style: editorContentStyle },
15389
+ // Line Numbers
15390
+ createElement(
15391
+ "div",
15392
+ { style: lineNumbersStyle, "aria-hidden": "true" },
15393
+ ...lineNumbers
15394
+ ),
15395
+ // Code - contentEditable
14931
15396
  createElement(
14932
- "main",
15397
+ "code",
14933
15398
  {
14934
- className: "word-processor__document-area",
14935
- style: documentAreaStyle,
14936
- onClick: handleDocumentAreaClick
15399
+ style: codeAreaStyle,
15400
+ contentEditable: "true",
15401
+ ref: props.editorRef,
15402
+ onInput: props.onInput,
15403
+ suppressContentEditableWarning: true
14937
15404
  },
14938
- createElement(
14939
- "div",
14940
- {
14941
- className: "word-processor__page",
14942
- style: pageStyle,
14943
- contentEditable: "true",
14944
- ref: editorRef,
14945
- onInput: handleInput,
14946
- suppressContentEditableWarning: true
14947
- },
14948
- displayContent
14949
- )
15405
+ ...codeLines
15406
+ )
15407
+ );
15408
+ }
15409
+
15410
+ // ../components/page/ide/src/Minimap.ts
15411
+ var minimapStyle = {
15412
+ width: "60px",
15413
+ backgroundColor: "#1e1e1e",
15414
+ borderLeft: "1px solid var(--color-border, #252526)",
15415
+ flexShrink: "0",
15416
+ padding: "8px 4px",
15417
+ display: "flex",
15418
+ flexDirection: "column",
15419
+ gap: "2px",
15420
+ position: "relative"
15421
+ };
15422
+ function Minimap(props) {
15423
+ return createElement(
15424
+ "div",
15425
+ { className: "ide__minimap", style: minimapStyle, "aria-hidden": "true" },
15426
+ // Viewport indicator
15427
+ createElement("div", {
15428
+ style: {
15429
+ position: "absolute",
15430
+ top: `${props.visibleStart}px`,
15431
+ left: "0",
15432
+ right: "0",
15433
+ height: `${props.visibleEnd}px`,
15434
+ backgroundColor: "rgba(100, 100, 200, 0.15)",
15435
+ border: "1px solid rgba(100, 100, 200, 0.3)",
15436
+ borderRadius: "2px",
15437
+ pointerEvents: "none"
15438
+ }
15439
+ }),
15440
+ ...props.lines.map(
15441
+ (line, i) => createElement("div", {
15442
+ key: String(i),
15443
+ style: {
15444
+ height: "2px",
15445
+ backgroundColor: line.trim() ? "#555555" : "transparent",
15446
+ borderRadius: "1px",
15447
+ width: `${Math.min(100, line.length * 2)}%`
15448
+ }
15449
+ })
15450
+ )
15451
+ );
15452
+ }
15453
+
15454
+ // ../components/page/ide/src/StatusBar.ts
15455
+ var statusBarStyle = {
15456
+ height: "22px",
15457
+ backgroundColor: "#007acc",
15458
+ display: "flex",
15459
+ alignItems: "center",
15460
+ justifyContent: "space-between",
15461
+ padding: "0 12px",
15462
+ fontSize: "12px",
15463
+ color: "#ffffff",
15464
+ flexShrink: "0"
15465
+ };
15466
+ var statusItemStyle = {
15467
+ cursor: "pointer",
15468
+ padding: "0 6px",
15469
+ borderRadius: "3px",
15470
+ transition: "background-color 0.15s"
15471
+ };
15472
+ function StatusBar(props) {
15473
+ const renderItems = (items) => items.map(
15474
+ (item, i) => createElement(
15475
+ "span",
15476
+ {
15477
+ key: String(i),
15478
+ style: statusItemStyle,
15479
+ onClick: item.onClick
15480
+ },
15481
+ item.label
15482
+ )
15483
+ );
15484
+ return createElement(
15485
+ "div",
15486
+ { className: "ide__status-bar", style: statusBarStyle },
15487
+ createElement(
15488
+ "div",
15489
+ { style: { display: "flex", gap: "16px" } },
15490
+ ...renderItems(props.items)
14950
15491
  ),
14951
- // Status Bar
14952
15492
  createElement(
14953
15493
  "div",
14954
- { className: "word-processor__status-bar", style: statusBarStyle },
14955
- createElement("span", null, "Page 1 of 1"),
14956
- createElement("span", null, `${displayWordCount} words`),
14957
- createElement("span", null, "100%")
15494
+ { style: { display: "flex", gap: "16px" } },
15495
+ ...renderItems(props.rightItems)
14958
15496
  )
14959
15497
  );
14960
15498
  }
@@ -15127,125 +15665,6 @@ var FILE_CONTENTS = {
15127
15665
  ]
15128
15666
  };
15129
15667
  var SAMPLE_CODE = FILE_CONTENTS["App.ts"];
15130
- var KEYWORDS = /* @__PURE__ */ new Set([
15131
- "import",
15132
- "export",
15133
- "from",
15134
- "const",
15135
- "let",
15136
- "var",
15137
- "function",
15138
- "return",
15139
- "if",
15140
- "else",
15141
- "for",
15142
- "while",
15143
- "class",
15144
- "new",
15145
- "throw",
15146
- "try",
15147
- "catch",
15148
- "finally",
15149
- "typeof",
15150
- "instanceof",
15151
- "in",
15152
- "of",
15153
- "default",
15154
- "switch",
15155
- "case",
15156
- "break",
15157
- "continue",
15158
- "do",
15159
- "void",
15160
- "delete",
15161
- "yield",
15162
- "async",
15163
- "await"
15164
- ]);
15165
- var TYPES = /* @__PURE__ */ new Set([
15166
- "string",
15167
- "number",
15168
- "boolean",
15169
- "void",
15170
- "null",
15171
- "undefined",
15172
- "any",
15173
- "never",
15174
- "unknown",
15175
- "object",
15176
- "interface",
15177
- "type",
15178
- "enum"
15179
- ]);
15180
- var COL_KEYWORD = "#569cd6";
15181
- var COL_STRING = "#ce9178";
15182
- var COL_TYPE = "#4ec9b0";
15183
- var COL_COMMENT = "#6a9955";
15184
- var COL_FUNCTION = "#dcdcaa";
15185
- var COL_DEFAULT = "#d4d4d4";
15186
- var COL_PUNCTUATION = "#d4d4d4";
15187
- var COL_NUMBER = "#b5cea8";
15188
- function tokenizeLine(line) {
15189
- if (!line.trim()) return [{ text: "\xA0", color: COL_DEFAULT }];
15190
- const tokens = [];
15191
- let i = 0;
15192
- while (i < line.length) {
15193
- if (line[i] === "/" && line[i + 1] === "/") {
15194
- tokens.push({ text: line.slice(i), color: COL_COMMENT });
15195
- break;
15196
- }
15197
- if (line[i] === '"' || line[i] === "'" || line[i] === "`") {
15198
- const quote = line[i];
15199
- let j = i + 1;
15200
- while (j < line.length && line[j] !== quote) {
15201
- if (line[j] === "\\") j++;
15202
- j++;
15203
- }
15204
- j = Math.min(j + 1, line.length);
15205
- tokens.push({ text: line.slice(i, j), color: COL_STRING });
15206
- i = j;
15207
- continue;
15208
- }
15209
- if (/[0-9]/.test(line[i]) && (i === 0 || /[\s(,=:[\]{}+\-*/]/.test(line[i - 1]))) {
15210
- let j = i;
15211
- while (j < line.length && /[0-9.]/.test(line[j])) j++;
15212
- tokens.push({ text: line.slice(i, j), color: COL_NUMBER });
15213
- i = j;
15214
- continue;
15215
- }
15216
- if (/[a-zA-Z_$]/.test(line[i])) {
15217
- let j = i;
15218
- while (j < line.length && /[a-zA-Z0-9_$]/.test(line[j])) j++;
15219
- const word = line.slice(i, j);
15220
- let nextNonSpace = j;
15221
- while (nextNonSpace < line.length && line[nextNonSpace] === " ") nextNonSpace++;
15222
- const isCall = nextNonSpace < line.length && line[nextNonSpace] === "(";
15223
- let color = COL_DEFAULT;
15224
- if (KEYWORDS.has(word)) {
15225
- color = COL_KEYWORD;
15226
- } else if (TYPES.has(word)) {
15227
- color = COL_TYPE;
15228
- } else if (isCall) {
15229
- color = COL_FUNCTION;
15230
- } else if (word === "true" || word === "false") {
15231
- color = COL_KEYWORD;
15232
- }
15233
- tokens.push({ text: word, color });
15234
- i = j;
15235
- continue;
15236
- }
15237
- if (line[i] === " " || line[i] === " ") {
15238
- let j = i;
15239
- while (j < line.length && (line[j] === " " || line[j] === " ")) j++;
15240
- tokens.push({ text: line.slice(i, j), color: COL_DEFAULT });
15241
- i = j;
15242
- continue;
15243
- }
15244
- tokens.push({ text: line[i], color: COL_PUNCTUATION });
15245
- i++;
15246
- }
15247
- return tokens;
15248
- }
15249
15668
  function IDE(props) {
15250
15669
  const [activeFile, setActiveFile] = useState("App.ts");
15251
15670
  const [expandedFolders, setExpandedFolders] = useState({
@@ -15253,7 +15672,6 @@ function IDE(props) {
15253
15672
  components: true,
15254
15673
  hooks: true
15255
15674
  });
15256
- const [activeMenu, setActiveMenu] = useState(-1);
15257
15675
  const [lineCount, setLineCount] = useState(SAMPLE_CODE.length);
15258
15676
  const editorRef = useRef(null);
15259
15677
  const handleFileClick = useCallback((fileName) => {
@@ -15274,9 +15692,6 @@ function IDE(props) {
15274
15692
  return next;
15275
15693
  });
15276
15694
  }, []);
15277
- const handleMenuClick = useCallback((index) => {
15278
- setActiveMenu((prev) => prev === index ? -1 : index);
15279
- }, []);
15280
15695
  const handleMenuAction = useCallback((action) => {
15281
15696
  switch (action) {
15282
15697
  case "undo":
@@ -15299,107 +15714,38 @@ function IDE(props) {
15299
15714
  editorRef.current.textContent = "";
15300
15715
  setLineCount(1);
15301
15716
  }
15302
- break;
15303
- default:
15304
- break;
15305
- }
15306
- setActiveMenu(-1);
15307
- if (editorRef.current) {
15308
- editorRef.current.focus();
15309
- }
15310
- }, []);
15311
- const handleEditorInput = useCallback(() => {
15312
- if (editorRef.current) {
15313
- const text = editorRef.current.textContent ?? "";
15314
- const lines = text.split("\n");
15315
- setLineCount(Math.max(lines.length, 1));
15316
- }
15317
- }, []);
15318
- const containerStyle3 = useMemo(() => ({
15319
- width: "100%",
15320
- height: "100%",
15321
- minHeight: "500px",
15322
- display: "flex",
15323
- flexDirection: "column",
15324
- fontFamily: '"Segoe UI", Roboto, Arial, sans-serif',
15325
- fontSize: "13px",
15326
- color: "#cccccc",
15327
- backgroundColor: "#1e1e1e",
15328
- overflow: "hidden"
15329
- }), []);
15330
- const titleBarStyle = {
15331
- height: "30px",
15332
- backgroundColor: "#323233",
15333
- display: "flex",
15334
- alignItems: "center",
15335
- justifyContent: "center",
15336
- fontSize: "12px",
15337
- color: "#999",
15338
- flexShrink: "0",
15339
- borderBottom: "1px solid var(--color-border, #252526)"
15340
- };
15341
- const menuBarStyle = {
15342
- height: "28px",
15343
- backgroundColor: "#3c3c3c",
15344
- display: "flex",
15345
- alignItems: "center",
15346
- padding: "0 8px",
15347
- gap: "2px",
15348
- flexShrink: "0",
15349
- position: "relative"
15350
- };
15351
- const menuItemStyleBase = {
15352
- padding: "3px 8px",
15353
- fontSize: "12px",
15354
- color: "#cccccc",
15355
- cursor: "pointer",
15356
- borderRadius: "3px",
15357
- backgroundColor: "transparent",
15358
- border: "none",
15359
- position: "relative"
15360
- };
15361
- const menuItemStyleActive = {
15362
- ...menuItemStyleBase,
15363
- backgroundColor: "rgba(255,255,255,0.1)"
15364
- };
15365
- const dropdownStyle = {
15366
- position: "absolute",
15367
- top: "100%",
15368
- left: "0",
15369
- minWidth: "180px",
15370
- backgroundColor: "#2d2d2d",
15371
- border: "1px solid #454545",
15372
- borderRadius: "4px",
15373
- boxShadow: "0 4px 12px rgba(0,0,0,0.4)",
15374
- padding: "4px 0",
15375
- zIndex: "1000"
15376
- };
15377
- const dropdownItemStyle = {
15378
- display: "block",
15717
+ break;
15718
+ default:
15719
+ break;
15720
+ }
15721
+ if (editorRef.current) {
15722
+ editorRef.current.focus();
15723
+ }
15724
+ }, []);
15725
+ const handleEditorInput = useCallback(() => {
15726
+ if (editorRef.current) {
15727
+ const text = editorRef.current.textContent ?? "";
15728
+ const lines = text.split("\n");
15729
+ setLineCount(Math.max(lines.length, 1));
15730
+ }
15731
+ }, []);
15732
+ const containerStyle3 = useMemo(() => ({
15379
15733
  width: "100%",
15380
- padding: "6px 16px",
15381
- fontSize: "12px",
15734
+ height: "100%",
15735
+ minHeight: "500px",
15736
+ display: "flex",
15737
+ flexDirection: "column",
15738
+ fontFamily: '"Segoe UI", Roboto, Arial, sans-serif',
15739
+ fontSize: "13px",
15382
15740
  color: "#cccccc",
15383
- backgroundColor: "transparent",
15384
- border: "none",
15385
- textAlign: "left",
15386
- cursor: "pointer",
15387
- transition: "background 0.1s"
15388
- };
15741
+ backgroundColor: "#1e1e1e",
15742
+ overflow: "hidden"
15743
+ }), []);
15389
15744
  const mainAreaStyle = {
15390
15745
  flex: "1",
15391
15746
  display: "flex",
15392
15747
  overflow: "hidden"
15393
15748
  };
15394
- const sidebarStyle = {
15395
- width: "220px",
15396
- backgroundColor: "#252526",
15397
- borderRight: "none",
15398
- display: "flex",
15399
- flexDirection: "column",
15400
- flexShrink: "0",
15401
- overflowY: "auto"
15402
- };
15403
15749
  const sidebarResizeHandleStyle = {
15404
15750
  width: "1px",
15405
15751
  backgroundColor: "#007acc",
@@ -15408,206 +15754,16 @@ function IDE(props) {
15408
15754
  opacity: "0.4",
15409
15755
  transition: "opacity 0.2s"
15410
15756
  };
15411
- const sidebarHeaderStyle = {
15412
- padding: "8px 12px",
15413
- fontSize: "11px",
15414
- fontWeight: "600",
15415
- textTransform: "uppercase",
15416
- letterSpacing: "0.5px",
15417
- color: "#bbbbbb"
15418
- };
15419
- const fileItemStyle = (indent, isFolder, isActive) => ({
15420
- padding: "3px 8px",
15421
- paddingLeft: `${12 + indent * 16}px`,
15422
- fontSize: "13px",
15423
- cursor: "pointer",
15424
- color: isFolder ? "#cccccc" : "#d4d4d4",
15425
- whiteSpace: "nowrap",
15426
- overflow: "hidden",
15427
- textOverflow: "ellipsis",
15428
- borderRadius: "3px",
15429
- margin: "0 4px",
15430
- transition: "background-color 0.1s",
15431
- backgroundColor: isActive ? "rgba(255,255,255,0.08)" : "transparent"
15432
- });
15433
15757
  const editorAreaStyle = {
15434
15758
  flex: "1",
15435
15759
  display: "flex",
15436
15760
  flexDirection: "column",
15437
15761
  overflow: "hidden"
15438
15762
  };
15439
- const editorTabBarStyle = {
15440
- height: "35px",
15441
- backgroundColor: "#252526",
15442
- display: "flex",
15443
- alignItems: "center",
15444
- flexShrink: "0"
15445
- };
15446
- const activeTabStyle = {
15447
- padding: "0 16px",
15448
- height: "35px",
15449
- lineHeight: "35px",
15450
- backgroundColor: "#1e1e1e",
15451
- color: "#ffffff",
15452
- fontSize: "13px",
15453
- cursor: "pointer",
15454
- border: "none",
15455
- borderBottom: "2px solid #007acc",
15456
- boxSizing: "border-box"
15457
- };
15458
- const editorContentStyle = {
15459
- flex: "1",
15460
- display: "flex",
15461
- overflow: "auto",
15462
- backgroundColor: "#1e1e1e",
15463
- fontFamily: '"Cascadia Code", "Fira Code", "Consolas", monospace',
15464
- fontSize: "13px",
15465
- lineHeight: "20px"
15466
- };
15467
- const lineNumbersStyle = {
15468
- padding: "8px 0",
15469
- textAlign: "right",
15470
- color: "#858585",
15471
- userSelect: "none",
15472
- minWidth: "48px",
15473
- paddingRight: "12px",
15474
- paddingLeft: "12px",
15475
- flexShrink: "0"
15476
- };
15477
- const codeAreaStyle = {
15478
- padding: "8px 0",
15479
- flex: "1",
15480
- whiteSpace: "pre",
15481
- overflowX: "auto",
15482
- outline: "none",
15483
- color: "#d4d4d4"
15484
- };
15485
- const minimapStyle = {
15486
- width: "60px",
15487
- backgroundColor: "#1e1e1e",
15488
- borderLeft: "1px solid var(--color-border, #252526)",
15489
- flexShrink: "0",
15490
- padding: "8px 4px",
15491
- display: "flex",
15492
- flexDirection: "column",
15493
- gap: "2px",
15494
- position: "relative"
15495
- };
15496
- const statusBarStyle = {
15497
- height: "22px",
15498
- backgroundColor: "#007acc",
15499
- display: "flex",
15500
- alignItems: "center",
15501
- justifyContent: "space-between",
15502
- padding: "0 12px",
15503
- fontSize: "12px",
15504
- color: "#ffffff",
15505
- flexShrink: "0"
15506
- };
15507
- const statusItemStyle = {
15508
- cursor: "pointer",
15509
- padding: "0 6px",
15510
- borderRadius: "3px",
15511
- transition: "background-color 0.15s"
15512
- };
15513
15763
  const viewportTop = 8;
15514
15764
  const viewportHeight = 30;
15515
15765
  const currentCode = FILE_CONTENTS[activeFile] ?? SAMPLE_CODE;
15516
- const codeLines = currentCode.map((line, i) => {
15517
- const tokens = tokenizeLine(line);
15518
- const spans = [];
15519
- let spanIdx = 0;
15520
- for (const token of tokens) {
15521
- spans.push(
15522
- createElement("span", {
15523
- key: String(spanIdx++),
15524
- style: { color: token.color }
15525
- }, token.text)
15526
- );
15527
- }
15528
- return createElement(
15529
- "div",
15530
- {
15531
- key: String(i),
15532
- style: {
15533
- minHeight: "20px"
15534
- }
15535
- },
15536
- ...spans
15537
- );
15538
- });
15539
- const actualLineCount = Math.max(lineCount, currentCode.length);
15540
- const lineNumbers = [];
15541
- for (let i = 0; i < actualLineCount; i++) {
15542
- lineNumbers.push(createElement("div", {
15543
- key: String(i)
15544
- }, String(i + 1)));
15545
- }
15546
- const isItemVisible = (item) => {
15547
- if (!item.parent) return true;
15548
- if (!expandedFolders[item.parent]) return false;
15549
- const parentEntry = FILE_TREE.find((e) => e.name === item.parent && e.isFolder);
15550
- if (parentEntry) return isItemVisible(parentEntry);
15551
- return true;
15552
- };
15553
- const menuElements = MENUS2.map((menu, i) => {
15554
- const children = [menu];
15555
- const isActive = activeMenu === i;
15556
- if (isActive && MENU_ITEMS2[menu]) {
15557
- children.push(
15558
- createElement(
15559
- "div",
15560
- {
15561
- key: "dropdown",
15562
- style: dropdownStyle,
15563
- className: "ide__menu-dropdown"
15564
- },
15565
- ...MENU_ITEMS2[menu].map(
15566
- (item, j) => createElement(
15567
- "button",
15568
- {
15569
- key: String(j),
15570
- style: dropdownItemStyle,
15571
- onClick: (e) => {
15572
- e.stopPropagation();
15573
- handleMenuAction(item.action);
15574
- },
15575
- role: "menuitem"
15576
- },
15577
- item.label
15578
- )
15579
- )
15580
- )
15581
- );
15582
- }
15583
- return createElement(
15584
- "button",
15585
- {
15586
- key: String(i),
15587
- style: isActive ? menuItemStyleActive : menuItemStyleBase,
15588
- role: "menuitem",
15589
- "aria-label": menu,
15590
- onClick: () => handleMenuClick(i)
15591
- },
15592
- ...children
15593
- );
15594
- });
15595
- const fileTreeElements = FILE_TREE.map((item, i) => {
15596
- if (!isItemVisible(item)) return null;
15597
- const isActiveFile = !item.isFolder && item.name === activeFile;
15598
- const folderIcon = item.isFolder ? expandedFolders[item.name] ? "\u{1F4C2} " : "\u{1F4C1} " : "\u{1F4C4} ";
15599
- return createElement(
15600
- "div",
15601
- {
15602
- key: String(i),
15603
- style: fileItemStyle(item.indent, item.isFolder, isActiveFile),
15604
- onClick: item.isFolder ? () => handleFolderToggle(item.name) : () => handleFileClick(item.name)
15605
- },
15606
- folderIcon,
15607
- item.name
15608
- );
15609
- });
15610
- const visibleFileTreeElements = fileTreeElements.filter((el) => el !== null);
15766
+ void lineCount;
15611
15767
  return createElement(
15612
15768
  "div",
15613
15769
  {
@@ -15615,114 +15771,65 @@ function IDE(props) {
15615
15771
  style: containerStyle3
15616
15772
  },
15617
15773
  // Title Bar
15618
- createElement(
15619
- "div",
15620
- { className: "ide__title-bar", style: titleBarStyle },
15621
- "SpecifyJS IDE"
15622
- ),
15774
+ createElement(TitleBar, { title: "SpecifyJS IDE" }),
15623
15775
  // Menu Bar
15624
- createElement(
15625
- "div",
15626
- { className: "ide__menu-bar", style: menuBarStyle, role: "menubar" },
15627
- ...menuElements
15628
- ),
15776
+ createElement(MenuBar, {
15777
+ menus: MENUS2,
15778
+ menuItems: MENU_ITEMS2,
15779
+ onAction: handleMenuAction
15780
+ }),
15629
15781
  // Main Area
15630
15782
  createElement(
15631
15783
  "div",
15632
15784
  { style: mainAreaStyle },
15633
- // Sidebar
15634
- createElement(
15635
- "nav",
15636
- { className: "ide__sidebar", style: sidebarStyle, "aria-label": "File explorer" },
15637
- createElement("div", { style: sidebarHeaderStyle }, "Explorer"),
15638
- ...visibleFileTreeElements
15639
- ),
15785
+ // Sidebar File Explorer
15786
+ createElement(FileExplorer, {
15787
+ files: FILE_TREE,
15788
+ activeFile,
15789
+ expandedFolders,
15790
+ onFileClick: handleFileClick,
15791
+ onFolderToggle: handleFolderToggle
15792
+ }),
15640
15793
  // Resize handle between sidebar and editor
15641
15794
  createElement("div", { style: sidebarResizeHandleStyle }),
15642
15795
  // Editor Area
15643
15796
  createElement(
15644
15797
  "div",
15645
15798
  { style: editorAreaStyle },
15646
- // Tab Bar -- shows active file name
15647
- createElement(
15648
- "div",
15649
- { style: editorTabBarStyle },
15650
- createElement("button", { style: activeTabStyle, "aria-label": activeFile }, activeFile)
15651
- ),
15652
- // Editor Content
15653
- createElement(
15654
- "div",
15655
- { style: editorContentStyle },
15656
- // Line Numbers
15657
- createElement(
15658
- "div",
15659
- { style: lineNumbersStyle, "aria-hidden": "true" },
15660
- ...lineNumbers
15661
- ),
15662
- // Code - contentEditable
15663
- createElement(
15664
- "code",
15665
- {
15666
- style: codeAreaStyle,
15667
- contentEditable: "true",
15668
- ref: editorRef,
15669
- onInput: handleEditorInput,
15670
- suppressContentEditableWarning: true
15671
- },
15672
- ...codeLines
15673
- )
15674
- )
15799
+ // Tab Bar
15800
+ createElement(TabBar, {
15801
+ tabs: [activeFile],
15802
+ activeTab: activeFile,
15803
+ onTabClick: handleFileClick
15804
+ }),
15805
+ // Code Editor
15806
+ createElement(CodeEditor, {
15807
+ content: currentCode,
15808
+ onInput: handleEditorInput,
15809
+ editorRef
15810
+ })
15675
15811
  ),
15676
15812
  // Minimap
15677
- createElement(
15678
- "div",
15679
- { className: "ide__minimap", style: minimapStyle, "aria-hidden": "true" },
15680
- // Viewport indicator
15681
- createElement("div", {
15682
- style: {
15683
- position: "absolute",
15684
- top: `${viewportTop}px`,
15685
- left: "0",
15686
- right: "0",
15687
- height: `${viewportHeight}px`,
15688
- backgroundColor: "rgba(100, 100, 200, 0.15)",
15689
- border: "1px solid rgba(100, 100, 200, 0.3)",
15690
- borderRadius: "2px",
15691
- pointerEvents: "none"
15692
- }
15693
- }),
15694
- ...currentCode.map(
15695
- (line, i) => createElement("div", {
15696
- key: String(i),
15697
- style: {
15698
- height: "2px",
15699
- backgroundColor: line.trim() ? "#555555" : "transparent",
15700
- borderRadius: "1px",
15701
- width: `${Math.min(100, line.length * 2)}%`
15702
- }
15703
- })
15704
- )
15705
- )
15813
+ createElement(Minimap, {
15814
+ lines: currentCode,
15815
+ visibleStart: viewportTop,
15816
+ visibleEnd: viewportHeight,
15817
+ totalLines: currentCode.length
15818
+ })
15706
15819
  ),
15707
15820
  // Status Bar
15708
- createElement(
15709
- "div",
15710
- { className: "ide__status-bar", style: statusBarStyle },
15711
- createElement(
15712
- "div",
15713
- { style: { display: "flex", gap: "16px" } },
15714
- createElement("span", { style: statusItemStyle }, "\u2387 main"),
15715
- createElement("span", { style: statusItemStyle }, "0 errors"),
15716
- createElement("span", { style: statusItemStyle }, "0 warnings")
15717
- ),
15718
- createElement(
15719
- "div",
15720
- { style: { display: "flex", gap: "16px" } },
15721
- createElement("span", { style: statusItemStyle }, "Ln 1, Col 1"),
15722
- createElement("span", { style: statusItemStyle }, "UTF-8"),
15723
- createElement("span", { style: statusItemStyle }, "TypeScript")
15724
- )
15725
- )
15821
+ createElement(StatusBar, {
15822
+ items: [
15823
+ { label: "\u2387 main" },
15824
+ { label: "0 errors" },
15825
+ { label: "0 warnings" }
15826
+ ],
15827
+ rightItems: [
15828
+ { label: "Ln 1, Col 1" },
15829
+ { label: "UTF-8" },
15830
+ { label: "TypeScript" }
15831
+ ]
15832
+ })
15726
15833
  );
15727
15834
  }
15728
15835
 
@@ -16473,6 +16580,9 @@ function generateUUID() {
16473
16580
  function getItemId(item) {
16474
16581
  return isCard(item) ? item.card_id : item.container_id;
16475
16582
  }
16583
+ function getItemName(item) {
16584
+ return isCard(item) ? item.card_title : item.name;
16585
+ }
16476
16586
 
16477
16587
  // ../components/data/board/src/Card.ts
16478
16588
  var PRIORITY_COLORS = {
@@ -19539,7 +19649,7 @@ function ProjectManagerApp(props) {
19539
19649
  };
19540
19650
  dispatch({ type: "ADD_ITEM", item: newCard });
19541
19651
  }, [state.viewport, selectedColor, dispatch]);
19542
- const menuBarStyle = {
19652
+ const menuBarStyle2 = {
19543
19653
  display: "flex",
19544
19654
  alignItems: "center",
19545
19655
  height: "28px",
@@ -19606,7 +19716,7 @@ function ProjectManagerApp(props) {
19606
19716
  const appMenuBar = createElement(
19607
19717
  "div",
19608
19718
  {
19609
- style: menuBarStyle,
19719
+ style: menuBarStyle2,
19610
19720
  "data-testid": "app-menu-bar"
19611
19721
  },
19612
19722
  // Project menu
@@ -20959,6 +21069,47 @@ function UnityApp(props) {
20959
21069
  );
20960
21070
  }
20961
21071
 
21072
+ // ../components/data/board/src/NamespaceValidator.ts
21073
+ function collectContainerNamesInScope(items, excludeId) {
21074
+ const names = /* @__PURE__ */ new Set();
21075
+ const stack = [];
21076
+ for (let i = items.length - 1; i >= 0; i--) {
21077
+ stack.push(items[i]);
21078
+ }
21079
+ while (stack.length > 0) {
21080
+ const item = stack.pop();
21081
+ if (isContainer(item)) {
21082
+ if (excludeId && item.container_id === excludeId) continue;
21083
+ if (item.name) names.add(item.name);
21084
+ for (let i = item.contents.length - 1; i >= 0; i--) {
21085
+ stack.push(item.contents[i]);
21086
+ }
21087
+ }
21088
+ }
21089
+ return names;
21090
+ }
21091
+ function validateNameInScope(name, container, excludeId) {
21092
+ if (!name) return false;
21093
+ if (!excludeId || container.container_id !== excludeId) {
21094
+ if (container.name === name) return false;
21095
+ }
21096
+ const existingNames = collectContainerNamesInScope(container.contents, excludeId);
21097
+ return !existingNames.has(name);
21098
+ }
21099
+ function validateNameInBoard(name, collection, excludeId) {
21100
+ if (!name) return false;
21101
+ for (let i = 0; i < collection.length; i++) {
21102
+ const item = collection[i];
21103
+ if (!isContainer(item)) continue;
21104
+ if (excludeId && item.container_id === excludeId) continue;
21105
+ if (item.name === name) return false;
21106
+ }
21107
+ return true;
21108
+ }
21109
+ function validateNameForNesting(name, targetContainer, excludeId) {
21110
+ return validateNameInScope(name, targetContainer, excludeId);
21111
+ }
21112
+
20962
21113
  // ../components/form/button/src/Button.ts
20963
21114
  var SIZE_MAP6 = {
20964
21115
  sm: { padding: "3px 10px", fontSize: "12px", borderRadius: "4px" },
@@ -30087,29 +30238,48 @@ export {
30087
30238
  BarGraph,
30088
30239
  BigNumber,
30089
30240
  BlochSphere,
30241
+ Board,
30090
30242
  BoxPlot,
30091
30243
  Breadcrumb,
30092
30244
  BubbleChart,
30093
30245
  Button,
30246
+ CARD_TYPE_OPTIONS,
30247
+ COL_COMMENT,
30248
+ COL_DEFAULT,
30249
+ COL_FUNCTION,
30250
+ COL_KEYWORD,
30251
+ COL_NUMBER,
30252
+ COL_PUNCTUATION,
30253
+ COL_STRING,
30254
+ COL_TYPE,
30094
30255
  CalendarHeatMap,
30095
30256
  Card,
30257
+ CardComponent,
30258
+ CardLinkOverlay,
30096
30259
  Carousel,
30097
30260
  CartesianGraph2D,
30098
30261
  Checkbox,
30099
30262
  ChordDiagram,
30263
+ CodeEditor,
30100
30264
  ColorPicker,
30101
30265
  ColorWheel,
30102
30266
  ComplexGraph2D,
30267
+ ContainerComponent,
30103
30268
  ContextMenu,
30269
+ DEFAULT_BOARD_STATE,
30104
30270
  DataGrid,
30105
30271
  DatePicker,
30106
30272
  DecompositionTree,
30273
+ DesktopBackground,
30107
30274
  DigitalClock,
30108
30275
  DiscreteCartesian2D,
30276
+ Dock,
30109
30277
  DragDropProvider,
30278
+ DraggableWindow,
30110
30279
  Drawer,
30111
30280
  Dropdown,
30112
30281
  EmptyState,
30282
+ FileExplorer,
30113
30283
  FileUpload,
30114
30284
  FlexContainer,
30115
30285
  FlexItem,
@@ -30131,12 +30301,15 @@ export {
30131
30301
  ListView,
30132
30302
  LollipopChart,
30133
30303
  Matrix,
30304
+ MenuBar,
30134
30305
  Menubar,
30135
30306
  MessageBusProvider,
30307
+ Minimap,
30136
30308
  Modal,
30137
30309
  MultilineField,
30138
30310
  NavWrapper,
30139
30311
  NumberSpinner,
30312
+ PRIORITY_COLORS,
30140
30313
  Pagination,
30141
30314
  Panel,
30142
30315
  Partition,
@@ -30155,14 +30328,18 @@ export {
30155
30328
  Slider,
30156
30329
  Spinner,
30157
30330
  Splitter,
30331
+ StatusBar,
30158
30332
  Stepper,
30159
30333
  Sunburst,
30334
+ SystemTray,
30335
+ TabBar,
30160
30336
  Tabs,
30161
30337
  Tag,
30162
30338
  TextEditor,
30163
30339
  TextField,
30164
30340
  ThreeDLayers,
30165
30341
  TimePicker,
30342
+ TitleBar,
30166
30343
  ToastContainer,
30167
30344
  Toggle,
30168
30345
  Toolbar,
@@ -30180,10 +30357,12 @@ export {
30180
30357
  VirtualScroll,
30181
30358
  VizWrapper,
30182
30359
  WaterfallChart,
30360
+ WindowManagerProvider,
30183
30361
  WordCloud,
30184
30362
  WordProcessor,
30185
30363
  applyGate,
30186
30364
  blochToCartesian,
30365
+ boardReducer,
30187
30366
  buildInputStyle,
30188
30367
  buildNavItemStyle,
30189
30368
  buildRotationMatrix,
@@ -30196,12 +30375,20 @@ export {
30196
30375
  generateEdges,
30197
30376
  generateHypercube,
30198
30377
  generatePalette,
30378
+ generateUUID,
30199
30379
  generateVertices,
30380
+ getItemId,
30381
+ getItemName,
30382
+ historyReducer,
30383
+ isCard,
30384
+ isContainer,
30200
30385
  numRotationAngles,
30201
30386
  projectTo2D,
30387
+ tokenizeLine,
30202
30388
  transformVec,
30203
30389
  useAppId,
30204
30390
  useBarGraphScales,
30391
+ useBoardReducer,
30205
30392
  useChannel,
30206
30393
  useDragDrop,
30207
30394
  useDraggable,
@@ -30210,5 +30397,9 @@ export {
30210
30397
  useHypercube,
30211
30398
  useLineGraphScales,
30212
30399
  useMessageBus,
30213
- useToast
30400
+ useToast,
30401
+ useWindowManager,
30402
+ validateNameForNesting,
30403
+ validateNameInBoard,
30404
+ validateNameInScope
30214
30405
  };