@kubohiroya/turbowarp-plus-editor-code-views 0.0.0-stage → 0.2.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 (108) hide show
  1. package/LICENSE +373 -0
  2. package/README.ja.md +42 -0
  3. package/README.md +41 -2
  4. package/dist/asset-edit-session.d.ts +24 -0
  5. package/dist/asset-edit-session.js +58 -0
  6. package/dist/block-argument-text.d.ts +39 -0
  7. package/dist/block-argument-text.js +170 -0
  8. package/dist/block-drag.d.ts +17 -0
  9. package/dist/block-drag.js +184 -0
  10. package/dist/code-extensions.d.ts +38 -0
  11. package/dist/code-extensions.js +418 -0
  12. package/dist/code-pane.d.ts +80 -0
  13. package/dist/code-pane.js +398 -0
  14. package/dist/custom-extension-fields.d.ts +45 -0
  15. package/dist/custom-extension-fields.js +144 -0
  16. package/dist/detached-block-palette-view.d.ts +10 -0
  17. package/dist/detached-block-palette-view.js +62 -0
  18. package/dist/detached-block-palette.d.ts +41 -0
  19. package/dist/detached-block-palette.js +197 -0
  20. package/dist/dockview-unsaved.d.ts +45 -0
  21. package/dist/dockview-unsaved.js +123 -0
  22. package/dist/history.d.ts +57 -0
  23. package/dist/history.js +85 -0
  24. package/dist/index.d.ts +28 -0
  25. package/dist/index.js +729 -0
  26. package/dist/native-extension-field.d.ts +26 -0
  27. package/dist/native-extension-field.js +204 -0
  28. package/dist/native-field-svg.d.ts +20 -0
  29. package/dist/native-field-svg.js +156 -0
  30. package/dist/palette-category-reorder.d.ts +4 -0
  31. package/dist/palette-category-reorder.js +167 -0
  32. package/dist/palette-category-search.d.ts +26 -0
  33. package/dist/palette-category-search.js +74 -0
  34. package/dist/palette-dropdown-resize.d.ts +19 -0
  35. package/dist/palette-dropdown-resize.js +135 -0
  36. package/dist/parent-field-layout.d.ts +2 -0
  37. package/dist/parent-field-layout.js +90 -0
  38. package/dist/parent-field-mirror.d.ts +3 -0
  39. package/dist/parent-field-mirror.js +290 -0
  40. package/dist/parent-field-resources.d.ts +9 -0
  41. package/dist/parent-field-resources.js +199 -0
  42. package/dist/preview-chrome.d.ts +9 -0
  43. package/dist/preview-chrome.js +78 -0
  44. package/dist/procedure-editor.d.ts +9 -0
  45. package/dist/procedure-editor.js +122 -0
  46. package/dist/procedure-edits.d.ts +16 -0
  47. package/dist/procedure-edits.js +47 -0
  48. package/dist/programmatic-extension-field.d.ts +20 -0
  49. package/dist/programmatic-extension-field.js +69 -0
  50. package/dist/protocol.d.ts +15 -0
  51. package/dist/protocol.js +36 -0
  52. package/dist/script-layout-dialog.d.ts +10 -0
  53. package/dist/script-layout-dialog.js +93 -0
  54. package/dist/script-layout-view.d.ts +68 -0
  55. package/dist/script-layout-view.js +164 -0
  56. package/dist/script-layout-workspace.d.ts +45 -0
  57. package/dist/script-layout-workspace.js +55 -0
  58. package/dist/script-layout.d.ts +17 -0
  59. package/dist/script-layout.js +25 -0
  60. package/dist/script-view-menu.d.ts +46 -0
  61. package/dist/script-view-menu.js +161 -0
  62. package/dist/sprite-code-windows.d.ts +32 -0
  63. package/dist/sprite-code-windows.js +180 -0
  64. package/dist/stage-code-prewarm.d.ts +52 -0
  65. package/dist/stage-code-prewarm.js +216 -0
  66. package/dist/target-combobox.d.ts +10 -0
  67. package/dist/target-combobox.js +92 -0
  68. package/dist/variable-references.d.ts +1 -0
  69. package/dist/variable-references.js +87 -0
  70. package/dist/workspace.d.ts +104 -0
  71. package/dist/workspace.js +1102 -0
  72. package/package.json +100 -4
  73. package/src/asset-edit-session.ts +72 -0
  74. package/src/block-argument-text.ts +172 -0
  75. package/src/block-drag.ts +190 -0
  76. package/src/code-extensions.ts +394 -0
  77. package/src/code-pane.ts +393 -0
  78. package/src/custom-extension-fields.ts +154 -0
  79. package/src/detached-block-palette-view.tsx +97 -0
  80. package/src/detached-block-palette.ts +218 -0
  81. package/src/dockview-unsaved.ts +134 -0
  82. package/src/history.ts +114 -0
  83. package/src/index.ts +680 -0
  84. package/src/native-extension-field.ts +201 -0
  85. package/src/native-field-svg.ts +140 -0
  86. package/src/palette-category-reorder.ts +155 -0
  87. package/src/palette-category-search.ts +82 -0
  88. package/src/palette-dropdown-resize.ts +132 -0
  89. package/src/parent-field-layout.ts +88 -0
  90. package/src/parent-field-mirror.ts +260 -0
  91. package/src/parent-field-resources.ts +179 -0
  92. package/src/preview-chrome.ts +82 -0
  93. package/src/procedure-editor.ts +123 -0
  94. package/src/procedure-edits.ts +46 -0
  95. package/src/programmatic-extension-field.ts +76 -0
  96. package/src/protocol.ts +47 -0
  97. package/src/script-layout-dialog.ts +104 -0
  98. package/src/script-layout-view.ts +198 -0
  99. package/src/script-layout-workspace.ts +95 -0
  100. package/src/script-layout.ts +40 -0
  101. package/src/script-view-menu.ts +213 -0
  102. package/src/sprite-code-windows.tsx +183 -0
  103. package/src/stage-code-prewarm.ts +242 -0
  104. package/src/styles.css +595 -0
  105. package/src/target-combobox.tsx +106 -0
  106. package/src/variable-references.ts +85 -0
  107. package/src/workspace.ts +1125 -0
  108. package/tsconfig.json +23 -0
@@ -0,0 +1,104 @@
1
+ import { type CodeTarget } from './history.ts';
2
+ import { captureCodePreviewChrome } from './preview-chrome.ts';
3
+ import type { PresentationElements } from './preview-chrome.ts';
4
+ import { type ScriptView } from './script-layout-view.ts';
5
+ export type AttachPreviewMinimap = (workspace: any, ScratchBlocks: any, watermark: HTMLElement) => {
6
+ dispose(): void;
7
+ };
8
+ /** Adds the code area's zoom buttons and minimap to another workspace. */
9
+ export type AttachWorkspaceNavigation = (workspace: any, ScratchBlocks: any) => {
10
+ dispose(): void;
11
+ } | undefined;
12
+ export interface Presentation {
13
+ scale: number;
14
+ x: number;
15
+ y: number;
16
+ visible: boolean;
17
+ scriptView?: ScriptView;
18
+ /** Missing for a presentation read back from a saved workspace; the preview then draws without it. */
19
+ chrome?: ReturnType<typeof captureCodePreviewChrome>;
20
+ }
21
+ interface CodeSession {
22
+ frontView: {
23
+ target: object;
24
+ mount: HTMLElement;
25
+ presentation?: Presentation;
26
+ } | null;
27
+ bridge: ReturnType<typeof attachCodeWorkspace> | null;
28
+ subscribe(listener: () => void): () => void;
29
+ changed(): void;
30
+ }
31
+ export declare function getCodeSession(vm: object): CodeSession;
32
+ type MeasuredField = {
33
+ textElement_?: {
34
+ textContent?: string | null;
35
+ } | null;
36
+ size_?: {
37
+ width: number;
38
+ };
39
+ };
40
+ type MeasuredBlock = {
41
+ rendered?: boolean;
42
+ inputList: {
43
+ fieldRow: MeasuredField[];
44
+ }[];
45
+ getRootBlock(): MeasuredBlock;
46
+ getDescendants(ordered: boolean): MeasuredBlock[];
47
+ render(bubble?: boolean): void;
48
+ };
49
+ export declare function remeasureHiddenFields(workspace: {
50
+ getAllBlocks(ordered: boolean): MeasuredBlock[];
51
+ }): boolean;
52
+ export declare function attachCodeWorkspace({ vm, ScratchBlocks: blocks, workspace, options, onError, presentationElements }: {
53
+ vm: any;
54
+ ScratchBlocks: any;
55
+ workspace: any;
56
+ options: any;
57
+ onError: any;
58
+ presentationElements?: PresentationElements;
59
+ }): {
60
+ onError: any;
61
+ capturePane(targetId: string): Presentation;
62
+ restorePane(targetId: string, presentation: Presentation): void;
63
+ prepareImport(target: any): ({ blockIds, rootBlockIds }: {
64
+ blockIds: any;
65
+ rootBlockIds: any;
66
+ }) => void;
67
+ blockListener(event: any): void;
68
+ beforeReload(): void;
69
+ load: (action: any) => any;
70
+ afterReload(): void;
71
+ select(view: any): boolean;
72
+ preview(element: any, chrome: any, view: any): {
73
+ workspace: any;
74
+ update(): void;
75
+ dispose(): void;
76
+ };
77
+ /**
78
+ * Show only one script in the code area, a hat or a function, or every script again without `id`.
79
+ * `onLost` runs when that script is deleted.
80
+ */
81
+ focusScript(id?: string, onLost?: () => void): void;
82
+ readonly focusedScript: string;
83
+ createFunction(target: CodeTarget & {
84
+ id: string;
85
+ }, kind: "procedure" | "named", name: string, { loadNamedFunctions }?: {
86
+ loadNamedFunctions?(): Promise<void>;
87
+ }): Promise<string>;
88
+ editProcedure(element: HTMLElement, { target, definitionId, editable, attachNavigation, locale, focusBlock }: {
89
+ target: CodeTarget & {
90
+ id: string;
91
+ };
92
+ definitionId: string;
93
+ editable: boolean;
94
+ attachNavigation?: AttachWorkspaceNavigation;
95
+ locale?: string;
96
+ focusBlock?: string;
97
+ }): {
98
+ workspace: any;
99
+ showBlock(id: string): void;
100
+ dispose(): void;
101
+ };
102
+ dispose(): void;
103
+ };
104
+ export {};