@kubohiroya/turbowarp-text-lines 0.1.1 → 0.2.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.
@@ -7,83 +7,368 @@
7
7
  (function (Scratch) {
8
8
  'use strict';
9
9
 
10
- const extensionName = "Text Lines";
11
- const blocks = [{ "opcode": "lineCount", "blockType": "REPORTER", "text": "number of lines in [TEXT]", "description": "Returns the number of lines in the supplied text.", "arguments": { "TEXT": { "type": "STRING", "defaultValue": "first line\nsecond line" } } }, { "opcode": "lineAt", "blockType": "REPORTER", "text": "line [LINE] of [TEXT]", "description": "Returns one line using a one-based line number. Invalid line numbers return an empty string.", "arguments": { "TEXT": { "type": "STRING", "defaultValue": "first line\nsecond line" }, "LINE": { "type": "NUMBER", "defaultValue": 1 } } }, { "opcode": "writeLinesToList", "blockType": "COMMAND", "text": "put lines of [TEXT] into list [LIST]", "description": "Replaces the contents of the named Scratch list with the lines of the supplied text.", "arguments": { "TEXT": { "type": "STRING", "defaultValue": "first line\nsecond line" }, "LIST": { "type": "STRING", "menu": "LIST_MENU" } } }];
12
- const definitions = {
13
- extensionName,
14
- blocks
10
+ //#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.2.1_react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/fixed-input-schema.js
11
+ var numberToken = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u;
12
+ var invalidNumber = Object.freeze({
13
+ kind: "invalid",
14
+ code: "fixed-number-input-invalid"
15
+ });
16
+ /**
17
+ * Parse a NEW numeric draft according to NP-finite-new-input-v1.
18
+ * Never apply this to opening/no-op raw values or use it as an owner validator.
19
+ * Keep the validated token so negative zero, precision and exponent spelling survive.
20
+ */
21
+ function parseFixedNumberInput(input) {
22
+ if (typeof input === "number") {
23
+ if (!Number.isFinite(input)) return invalidNumber;
24
+ return Object.freeze({
25
+ kind: "valid",
26
+ token: Object.is(input, -0) ? "-0" : String(input),
27
+ value: input
28
+ });
29
+ }
30
+ if (typeof input !== "string") return invalidNumber;
31
+ const token = input.trim();
32
+ if (!numberToken.test(token)) return invalidNumber;
33
+ const value = Number(token);
34
+ return Number.isFinite(value) ? Object.freeze({
35
+ kind: "valid",
36
+ token,
37
+ value
38
+ }) : invalidNumber;
39
+ }
40
+ var block_editor_fixed_inputs_schema_default = {
41
+ $schema: "https://json-schema.org/draft/2020-12/schema",
42
+ $id: "https://kubohiroya.github.io/turbowarp-text-lines/schemas/block-editor-fixed-inputs.schema.json",
43
+ $defs: { "lineAt": {
44
+ "type": "object",
45
+ "properties": { "LINE": { "type": "number" } },
46
+ "required": ["LINE"],
47
+ "additionalProperties": true
48
+ } }
15
49
  };
16
- const blockDefinitions = definitions.blocks;
17
- class TextLinesExtension {
18
- getInfo() {
19
- const translate = Scratch.translate;
20
- return {
21
- id: "kubohiroyatextlines",
22
- name: translate(definitions.extensionName),
23
- docsURI: "https://kubohiroya.github.io/turbowarp-text-lines/",
24
- color1: "#5B80A5",
25
- blocks: blockDefinitions.map((block) => this.toScratchBlock(block)),
26
- menus: {
27
- LIST_MENU: {
28
- acceptReporters: true,
29
- items: "getLists"
30
- }
31
- }
32
- };
33
- }
34
- getLists() {
35
- const stage = Scratch.vm.runtime.getTargetForStage();
36
- const editingTarget = Scratch.vm.editingTarget;
37
- const lists = [
38
- ...stage ? Object.values(stage.variables) : [],
39
- ...editingTarget && editingTarget !== stage ? Object.values(editingTarget.variables) : []
40
- ].filter((variable) => variable.type === "list");
41
- if (lists.length === 0) return [""];
42
- return lists.map((list) => ({ text: list.name, value: list.id }));
43
- }
44
- lineCount(args) {
45
- return splitLines(Scratch.Cast.toString(args.TEXT)).length;
46
- }
47
- lineAt(args) {
48
- const lines = splitLines(Scratch.Cast.toString(args.TEXT));
49
- const line = Math.trunc(Scratch.Cast.toNumber(args.LINE));
50
- if (!Number.isFinite(line) || line < 1 || line > lines.length) return "";
51
- return lines[line - 1] ?? "";
52
- }
53
- writeLinesToList(args, util) {
54
- const listIdOrName = Scratch.Cast.toString(args.LIST);
55
- const stage = Scratch.vm.runtime.getTargetForStage();
56
- const variable = util.target.lookupVariableById(listIdOrName) ?? stage?.lookupVariableById(listIdOrName) ?? util.target.lookupVariableByNameAndType(listIdOrName, "list") ?? stage?.lookupVariableByNameAndType(listIdOrName, "list");
57
- if (!variable || variable.type !== "list") throw new Error(`List not found: ${listIdOrName}`);
58
- variable.value = splitLines(Scratch.Cast.toString(args.TEXT));
59
- variable._monitorUpToDate = false;
60
- }
61
- toScratchBlock(block) {
62
- return {
63
- opcode: block.opcode,
64
- blockType: Scratch.BlockType[block.blockType],
65
- text: Scratch.translate(block.text),
66
- arguments: Object.fromEntries(
67
- Object.entries(block.arguments).map(([name, argument]) => [
68
- name,
69
- Object.fromEntries(
70
- Object.entries({
71
- type: Scratch.ArgumentType[argument.type],
72
- defaultValue: argument.defaultValue,
73
- menu: argument.menu
74
- }).filter(([, value]) => value !== void 0)
75
- )
76
- ])
77
- )
78
- };
79
- }
50
+ //#endregion
51
+ //#region src/fixed-input-schema.ts
52
+ var repository$1 = "turbowarp-text-lines";
53
+ /** The owner JSON document is canonical; this selects a primitive field fragment. */
54
+ function fixedInputBundle(opcode, argument) {
55
+ const source = {
56
+ repository: repository$1,
57
+ path: "schemas/block-editor-fixed-inputs.schema.json",
58
+ symbol: `#/$defs/${opcode}/properties/${argument}`
59
+ };
60
+ const blocks = block_editor_fixed_inputs_schema_default.$defs;
61
+ return {
62
+ identity: {
63
+ ownerId: repository$1,
64
+ contractId: opcode,
65
+ revision: "fixed-inputs-v1",
66
+ variantId: argument
67
+ },
68
+ dialect: "2020-12",
69
+ root: {
70
+ retrievalUri: block_editor_fixed_inputs_schema_default.$id,
71
+ document: blocks[opcode].properties[argument],
72
+ artifact: {
73
+ role: "canonical-schema",
74
+ source
75
+ }
76
+ },
77
+ resources: [],
78
+ provenance: {
79
+ canonicalSources: [source, {
80
+ repository: repository$1,
81
+ path: "src/extension.ts",
82
+ symbol: opcode
83
+ }],
84
+ generatedFiles: [],
85
+ referenceSchemas: [],
86
+ generationSources: []
87
+ }
88
+ };
80
89
  }
81
- function splitLines(text) {
82
- return text.split(/\r\n|\n|\r/);
90
+ //#endregion
91
+ //#region src/fixed-input-editors.ts
92
+ var extensionId = "kubohiroyatextlines";
93
+ var repository = "turbowarp-text-lines";
94
+ var fields = [{
95
+ "opcode": "lineAt",
96
+ "argument": "LINE",
97
+ "control": "number",
98
+ "choices": [],
99
+ "normalization": "identity",
100
+ "shape": "math_number.NUM",
101
+ "maxBytes": false
102
+ }];
103
+ function literalString(value) {
104
+ if (typeof value !== "string") throw new TypeError("Expected a string literal.");
105
+ return value;
106
+ }
107
+ /** Legacy nonempty finite aliases are projections; opening never creates a write. */
108
+ function existingFixedNumber(value) {
109
+ if (typeof value !== "string" && typeof value !== "number" || typeof value === "string" && value.trim() === "") throw new TypeError("Unavailable numeric projection.");
110
+ const number = Number(value);
111
+ if (!Number.isFinite(number)) throw new TypeError("Unavailable numeric projection.");
112
+ return number;
113
+ }
114
+ function normalizeChoice(field, raw) {
115
+ if (field.normalization === "lowercase") return raw.toLowerCase();
116
+ if (field.normalization === "method") return raw.trim().toUpperCase();
117
+ if (field.normalization === "trim") return raw.trim();
118
+ if (field.normalization === "parse-format") {
119
+ const lower = raw.trim().toLowerCase();
120
+ return lower === "json" ? "JSON" : lower === "yaml" ? "YAML" : lower === "auto" ? "auto" : raw;
121
+ }
122
+ return raw;
83
123
  }
84
- if (!Scratch.extensions.unsandboxed) {
85
- throw new Error("Text Lines must run unsandboxed to write to Scratch lists.");
124
+ function binding(field) {
125
+ return {
126
+ argument: field.argument,
127
+ schemaBundle: fixedInputBundle(field.opcode, field.argument),
128
+ control: {
129
+ kind: field.control,
130
+ ...field.control === "enum" ? { choices: field.choices.map((value) => ({ value })) } : {}
131
+ },
132
+ read(value) {
133
+ return field.control === "number" ? existingFixedNumber(value) : normalizeChoice(field, literalString(value));
134
+ },
135
+ encode(value) {
136
+ if (field.control === "number") {
137
+ const parsed = parseFixedNumberInput(value);
138
+ if (parsed.kind !== "valid") throw new TypeError("Invalid new numeric input.");
139
+ return parsed.token;
140
+ }
141
+ const raw = literalString(value), normalized = normalizeChoice(field, raw);
142
+ if (!field.choices.includes(normalized)) throw new TypeError("Unsupported fixed choice.");
143
+ return field.shape === "menu-shadow" || field.shape === "direct-field-dropdown" ? normalized : raw;
144
+ },
145
+ validateCandidate(value) {
146
+ try {
147
+ if (field.control === "number") {
148
+ const number = existingFixedNumber(value);
149
+ if (field.maxBytes && (!Number.isSafeInteger(Math.trunc(number)) || Math.trunc(number) < 1)) return [{ message: "Invalid named body size." }];
150
+ return [];
151
+ }
152
+ return field.choices.includes(normalizeChoice(field, literalString(value))) ? [] : [{ message: "Unsupported fixed choice." }];
153
+ } catch {
154
+ return [{ message: "Invalid fixed input." }];
155
+ }
156
+ }
157
+ };
158
+ }
159
+ var fixedInputEditors = [...new Set(fields.map((f) => f.opcode))].map((opcode) => ({
160
+ apiVersion: 1,
161
+ extensionId,
162
+ editorId: `${opcode}-fixed-inputs`,
163
+ opcodes: [`${extensionId}_${opcode}`],
164
+ contractId: `${repository}/${opcode}`,
165
+ contractRevision: "fixed-inputs-v1",
166
+ bindings: fields.filter((field) => field.opcode === opcode).map(binding),
167
+ validationContext: () => ({
168
+ consumerId: repository,
169
+ nowMs: 0,
170
+ settings: null
171
+ })
172
+ }));
173
+ /** Registration follows the advertised opcode membership and the optional host capability. */
174
+ function fixedInputRegistration(scratch) {
175
+ const host = scratch ?? {};
176
+ let active;
177
+ let membership = "";
178
+ const removers = [];
179
+ let stopped = false;
180
+ const clear = () => {
181
+ host.vm?.runtime?.off?.("RUNTIME_DISPOSED", shutdown);
182
+ for (const remove of removers.splice(0).reverse()) remove();
183
+ active = void 0;
184
+ membership = "";
185
+ };
186
+ const shutdown = () => {
187
+ stopped = true;
188
+ clear();
189
+ };
190
+ return {
191
+ ensure(visibleOpcodes) {
192
+ const api = host.gui?.blockEditors;
193
+ const definitions = fixedInputEditors.filter((definition) => definition.opcodes.every((opcode) => visibleOpcodes.includes(opcode)));
194
+ const key = definitions.map((definition) => definition.editorId).join(",");
195
+ if (stopped || api === active && membership === key) return;
196
+ clear();
197
+ if (api?.apiVersion !== 1 || typeof api.registerFixedInputEditor !== "function" || !definitions.length) return;
198
+ try {
199
+ for (const definition of definitions) {
200
+ const remove = api.registerFixedInputEditor.call(api, definition);
201
+ if (typeof remove !== "function") throw new TypeError("Invalid fixed input cleanup.");
202
+ removers.push(remove);
203
+ }
204
+ active = api;
205
+ membership = key;
206
+ host.vm?.runtime?.on?.("RUNTIME_DISPOSED", shutdown);
207
+ } catch (error) {
208
+ clear();
209
+ throw error;
210
+ }
211
+ },
212
+ dispose: shutdown
213
+ };
214
+ }
215
+ var block_definitions_default = {
216
+ extensionName: "Text Lines",
217
+ blocks: [
218
+ {
219
+ "opcode": "lineCount",
220
+ "blockType": "REPORTER",
221
+ "text": "number of lines in [TEXT]",
222
+ "description": "Returns the number of lines in the supplied text.",
223
+ "arguments": { "TEXT": {
224
+ "type": "STRING",
225
+ "defaultValue": "first line\nsecond line"
226
+ } }
227
+ },
228
+ {
229
+ "opcode": "lineAt",
230
+ "blockType": "REPORTER",
231
+ "text": "line [LINE] of [TEXT]",
232
+ "description": "Returns one line using a one-based line number. Invalid line numbers return an empty string.",
233
+ "arguments": {
234
+ "TEXT": {
235
+ "type": "STRING",
236
+ "defaultValue": "first line\nsecond line"
237
+ },
238
+ "LINE": {
239
+ "type": "NUMBER",
240
+ "defaultValue": 1
241
+ }
242
+ }
243
+ },
244
+ {
245
+ "opcode": "writeLinesToList",
246
+ "blockType": "COMMAND",
247
+ "text": "put lines of [TEXT] into list [LIST]",
248
+ "description": "Replaces the contents of the named Scratch list with the lines of the supplied text.",
249
+ "arguments": {
250
+ "TEXT": {
251
+ "type": "STRING",
252
+ "defaultValue": "first line\nsecond line"
253
+ },
254
+ "LIST": {
255
+ "type": "STRING",
256
+ "menu": "LIST_MENU"
257
+ }
258
+ }
259
+ }
260
+ ]
261
+ };
262
+ //#endregion
263
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
264
+ function _typeof(o) {
265
+ "@babel/helpers - typeof";
266
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
267
+ return typeof o;
268
+ } : function(o) {
269
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
270
+ }, _typeof(o);
271
+ }
272
+ //#endregion
273
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
274
+ function toPrimitive(t, r) {
275
+ if ("object" != _typeof(t) || !t) return t;
276
+ var e = t[Symbol.toPrimitive];
277
+ if (void 0 !== e) {
278
+ var i = e.call(t, r || "default");
279
+ if ("object" != _typeof(i)) return i;
280
+ throw new TypeError("@@toPrimitive must return a primitive value.");
281
+ }
282
+ return ("string" === r ? String : Number)(t);
283
+ }
284
+ //#endregion
285
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
286
+ function toPropertyKey(t) {
287
+ var i = toPrimitive(t, "string");
288
+ return "symbol" == _typeof(i) ? i : i + "";
289
+ }
290
+ //#endregion
291
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
292
+ function _defineProperty(e, r, t) {
293
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
294
+ value: t,
295
+ enumerable: !0,
296
+ configurable: !0,
297
+ writable: !0
298
+ }) : e[r] = t, e;
299
+ }
300
+ //#endregion
301
+ //#region src/extension.ts
302
+ var blockDefinitions = block_definitions_default.blocks;
303
+ var TextLinesExtension = class {
304
+ constructor() {
305
+ _defineProperty(this, "fixedInputs", fixedInputRegistration(typeof Scratch === "undefined" ? void 0 : Scratch));
306
+ }
307
+ dispose() {
308
+ this.fixedInputs.dispose();
309
+ }
310
+ getInfo() {
311
+ this.fixedInputs.ensure(blockDefinitions.map((block) => `kubohiroyatextlines_${block.opcode}`));
312
+ const translate = Scratch.translate;
313
+ return {
314
+ id: "kubohiroyatextlines",
315
+ name: translate(block_definitions_default.extensionName),
316
+ docsURI: "https://kubohiroya.github.io/turbowarp-text-lines/",
317
+ color1: "#5B80A5",
318
+ blocks: blockDefinitions.map((block) => this.toScratchBlock(block)),
319
+ menus: { LIST_MENU: {
320
+ acceptReporters: true,
321
+ items: "getLists"
322
+ } }
323
+ };
324
+ }
325
+ getLists() {
326
+ const stage = Scratch.vm.runtime.getTargetForStage();
327
+ const editingTarget = Scratch.vm.editingTarget;
328
+ const lists = [...stage ? Object.values(stage.variables) : [], ...editingTarget && editingTarget !== stage ? Object.values(editingTarget.variables) : []].filter((variable) => variable.type === "list");
329
+ if (lists.length === 0) return [""];
330
+ return lists.map((list) => ({
331
+ text: list.name,
332
+ value: list.id
333
+ }));
334
+ }
335
+ lineCount(args) {
336
+ return splitLines(Scratch.Cast.toString(args.TEXT)).length;
337
+ }
338
+ lineAt(args) {
339
+ const lines = splitLines(Scratch.Cast.toString(args.TEXT));
340
+ const line = Math.trunc(Scratch.Cast.toNumber(args.LINE));
341
+ if (!Number.isFinite(line) || line < 1 || line > lines.length) return "";
342
+ return lines[line - 1] ?? "";
343
+ }
344
+ writeLinesToList(args, util) {
345
+ const listIdOrName = Scratch.Cast.toString(args.LIST);
346
+ const stage = Scratch.vm.runtime.getTargetForStage();
347
+ const variable = util.target.lookupVariableById(listIdOrName) ?? stage?.lookupVariableById(listIdOrName) ?? util.target.lookupVariableByNameAndType(listIdOrName, "list") ?? stage?.lookupVariableByNameAndType(listIdOrName, "list");
348
+ if (!variable || variable.type !== "list") throw new Error(`List not found: ${listIdOrName}`);
349
+ variable.value = splitLines(Scratch.Cast.toString(args.TEXT));
350
+ variable._monitorUpToDate = false;
351
+ }
352
+ toScratchBlock(block) {
353
+ return {
354
+ opcode: block.opcode,
355
+ blockType: Scratch.BlockType[block.blockType],
356
+ text: Scratch.translate(block.text),
357
+ arguments: Object.fromEntries(Object.entries(block.arguments).map(([name, argument]) => [name, Object.fromEntries(Object.entries({
358
+ type: Scratch.ArgumentType[argument.type],
359
+ defaultValue: argument.defaultValue,
360
+ menu: argument.menu
361
+ }).filter(([, value]) => value !== void 0))]))
362
+ };
363
+ }
364
+ };
365
+ function splitLines(text) {
366
+ return text.split(/\r\n|\n|\r/);
86
367
  }
368
+ //#endregion
369
+ //#region src/index.ts
370
+ if (!Scratch.extensions.unsandboxed) throw new Error("Text Lines must run unsandboxed to write to Scratch lists.");
87
371
  Scratch.extensions.register(new TextLinesExtension());
372
+ //#endregion
88
373
 
89
374
  })(Scratch);
@@ -0,0 +1,17 @@
1
+ # 固定入力の編集
2
+
3
+ S3-4のローカル実装です。対応GUIの固定入力機能は既定OFFです。旧GUI・API無し・固定入力機能OFFではブロックの従来動作を保ちます。`getInfo()` に存在する対象opcodeだけ登録し、再取得・APIの置換・拡張の`dispose()`・runtimeの破棄に対応します。既存SOURCEエディターとopcodeは分離しています。
4
+
5
+ |ブロックopcode|引数|UI|
6
+ |---|---|---|
7
+ |`lineAt`|`LINE`|数値入力(NP)|
8
+
9
+ 数値の新規入力は、空白を除いた完全な有限JSON数値トークンを受け付け、指数表記・負のゼロ・表記を保持します。空文字、16進表記、先頭の`+`、先頭ゼロや未完成トークンは新規保存しません。既存値は開いただけで書き換えません。既存の有限数値別表記は参照用に投影し、未編集の生値を保ちます。未知の旧enum値も無操作では保存し直しません。
10
+
11
+ `LINE` は有限数を受け付け、既存の切捨てと範囲外時の空文字を維持します。リスト名候補や接続reporterは評価しません。
12
+
13
+ reporter接続は読取専用で、実行・置換しません。新しい選択や数値を保存するときだけ純粋codecとSchemaで検証します。検証失敗時は全変更を拒否し、ブロックや接続を部分的に書き換えません。
14
+
15
+ 正本は本ownerの `schemas/block-editor-fixed-inputs.schema.json`、TSモジュールは選択・参照用、`dist`は生成物です。外部候補取得や実行時Schema生成は行いません。
16
+
17
+ 切戻しはGUIの固定入力機能OFFで行えます。既存のプロジェクト形式・opcode・メニュー・defaultValue・実行時の処理は維持します。
package/package.json CHANGED
@@ -1,22 +1,65 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-text-lines",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
+ "description": "Use multiline text in TurboWarp projects with line counting, lookup, and list-writing blocks.",
4
5
  "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
6
+ "license": "MPL-2.0",
7
+ "homepage": "https://github.com/kubohiroya/turbowarp-text-lines#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kubohiroya/turbowarp-text-lines.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/kubohiroya/turbowarp-text-lines/issues"
14
+ },
15
+ "keywords": [
16
+ "turbowarp",
17
+ "scratch",
18
+ "extension",
19
+ "text",
20
+ "lines",
21
+ "list"
22
+ ],
5
23
  "type": "module",
6
- "devDependencies": {
7
- "@kubohiroya/vite-plugin-turbowarp-extension": "0.1.0",
8
- "typescript": "^5.9.3",
9
- "vite": "^7.3.6",
10
- "vitest": "^4.1.10"
24
+ "files": [
25
+ "dist/",
26
+ "README.md",
27
+ "LICENSE",
28
+ "schemas/",
29
+ "docs/fixed-input-editors.ja.md"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "registry": "https://registry.npmjs.org/"
34
+ },
35
+ "packageManager": "pnpm@11.11.0",
36
+ "engines": {
37
+ "node": ">=22.18.0"
11
38
  },
12
39
  "scripts": {
13
40
  "dev": "vite build --watch",
14
41
  "typecheck": "tsc --noEmit",
15
42
  "build": "vite build",
16
43
  "test": "vitest run",
17
- "docs": "node scripts/generate-readme.mjs",
18
- "docs:check": "npm run docs && git diff --exit-code -- README.md",
19
- "check:dist": "npm run build && git diff --exit-code -- dist",
20
- "check": "npm run typecheck && npm run test && npm run build && npm run docs:check && npm run check:dist"
44
+ "docs": "node scripts/generate-readme.ts",
45
+ "docs:check": "pnpm run docs && git diff --exit-code -- README.md",
46
+ "check:dist": "pnpm run build && git diff --exit-code -- dist",
47
+ "repo:check": "node scripts/check-repo.ts",
48
+ "pack:check": "npm pack --dry-run --ignore-scripts",
49
+ "check": "pnpm run typecheck && pnpm run test && pnpm run build && pnpm run docs:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check"
50
+ },
51
+ "devDependencies": {
52
+ "@kubohiroya/vite-plugin-turbowarp-extension": "0.6.1",
53
+ "@types/node": "^22.20.1",
54
+ "typescript": "^5.9.3",
55
+ "vite": "^8.2.2",
56
+ "vitest": "^4.1.10",
57
+ "@kubohiroya/turbowarp-extension-data-editor": "0.2.1"
58
+ },
59
+ "gitHead": "6c59c2dd0cc4634192a4e5c210fe4e09e4b8a0be",
60
+ "x-turbowarp-source": {
61
+ "revision": "6c59c2dd0cc4634192a4e5c210fe4e09e4b8a0be",
62
+ "revisionRole": "base-commit",
63
+ "sourceState": "local-release-overlay"
21
64
  }
22
- }
65
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kubohiroya.github.io/turbowarp-text-lines/schemas/block-editor-fixed-inputs.schema.json",
4
+ "$defs": {
5
+ "lineAt": {
6
+ "type": "object",
7
+ "properties": {
8
+ "LINE": {
9
+ "type": "number"
10
+ }
11
+ },
12
+ "required": [
13
+ "LINE"
14
+ ],
15
+ "additionalProperties": true
16
+ }
17
+ }
18
+ }
@@ -1,21 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
-
8
- jobs:
9
- check:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v4
13
- - uses: actions/setup-node@v4
14
- with:
15
- node-version: 22
16
- - run: npm install
17
- - run: npm run check
18
- - uses: actions/upload-artifact@v4
19
- with:
20
- name: text-lines-dist
21
- path: dist/
@@ -1,37 +0,0 @@
1
- name: Deploy user documentation
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- paths:
7
- - docs/**
8
- - .github/workflows/pages.yml
9
- workflow_dispatch:
10
-
11
- permissions:
12
- contents: read
13
- pages: write
14
- id-token: write
15
-
16
- concurrency:
17
- group: pages
18
- cancel-in-progress: false
19
-
20
- jobs:
21
- deploy:
22
- environment:
23
- name: github-pages
24
- url: ${{ steps.deployment.outputs.page_url }}
25
- runs-on: ubuntu-latest
26
- steps:
27
- - name: Check out repository
28
- uses: actions/checkout@v6
29
- - name: Configure GitHub Pages
30
- uses: actions/configure-pages@v5
31
- - name: Upload documentation
32
- uses: actions/upload-pages-artifact@v4
33
- with:
34
- path: docs
35
- - name: Deploy documentation
36
- id: deployment
37
- uses: actions/deploy-pages@v4
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
- <rect width="64" height="64" rx="16" fill="#5b80a5"/>
3
- <path d="M17 21h30M17 32h30M17 43h22" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="6"/>
4
- </svg>