@kubohiroya/turbowarp-text-lines 0.4.0 → 0.5.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.
- package/README.ja.md +12 -0
- package/README.md +19 -1
- package/dist/text-lines.js +1 -1
- package/package.json +12 -5
package/README.ja.md
CHANGED
|
@@ -23,6 +23,18 @@ TurboWarpのプロジェクトで複数行テキストを扱います。Text Lin
|
|
|
23
23
|
|
|
24
24
|
そのまま使えるJavaScriptファイルをこのリポジトリにcommitしてあります。インストールにNode.jsは要りません。
|
|
25
25
|
|
|
26
|
+
## 実行できるサンプル
|
|
27
|
+
|
|
28
|
+
[**TurboWarp EditorでLines to Listを開く**](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-text-lines%2Fsamples%2Flines-to-list.sb3) · [SB3をダウンロード](https://kubohiroya.github.io/turbowarp-text-lines/samples/lines-to-list.sb3)
|
|
29
|
+
|
|
30
|
+
拡張の確認画面で**Run without sandbox**を選んで**Allow**し、緑の旗を押します。
|
|
31
|
+
行数`3`、2行目`Banana`、リスト`Apple, Banana, Cherry`を表示します。
|
|
32
|
+
最初の`Input text`設定ブロックを編集して試せます。再実行時はリストを置き換えます。
|
|
33
|
+
検証対象の拡張JSと背景をSB3へ同梱しており、追加のJS取得は不要です。
|
|
34
|
+
|
|
35
|
+
元データは`samples/lines-to-list/`にあります。`pnpm run samples:build`で再生成し、
|
|
36
|
+
`pnpm run samples:check`で更新漏れを検査します。[保守方法](samples/README.md)も参照してください。
|
|
37
|
+
|
|
26
38
|
## 動かしてみる
|
|
27
39
|
|
|
28
40
|
次のテキストを入力とします。
|
package/README.md
CHANGED
|
@@ -16,13 +16,31 @@ Use multiline text in TurboWarp projects. Text Lines adds three blocks that can:
|
|
|
16
16
|
|
|
17
17
|
1. Download [`dist/text-lines.js`](dist/text-lines.js?raw=1).
|
|
18
18
|
2. In **TurboWarp Desktop**, open **Extensions**, choose **Custom Extension**, and load the downloaded file.
|
|
19
|
-
3. Enable **Run
|
|
19
|
+
3. Enable **Run without sandbox** when TurboWarp asks.
|
|
20
20
|
|
|
21
21
|
> [!IMPORTANT]
|
|
22
22
|
> Text Lines needs to run without the sandbox because its command block writes directly to Scratch lists.
|
|
23
23
|
|
|
24
24
|
The ready-to-use JavaScript file is committed to this repository. You do not need Node.js to install the extension.
|
|
25
25
|
|
|
26
|
+
## Runnable sample
|
|
27
|
+
|
|
28
|
+
[**Open Lines to List in TurboWarp Editor**](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-text-lines%2Fsamples%2Flines-to-list.sb3) · [Download the SB3](https://kubohiroya.github.io/turbowarp-text-lines/samples/lines-to-list.sb3)
|
|
29
|
+
|
|
30
|
+
Allow the custom extension to load, choose **Run without sandbox**, and
|
|
31
|
+
click the green flag. The stage shows **Line count: 3**, **Second line: Banana**,
|
|
32
|
+
and a **Lines** list containing Apple, Banana, and Cherry. Running it again replaces
|
|
33
|
+
the list. The sample uses all three Text Lines blocks and no other extensions.
|
|
34
|
+
|
|
35
|
+
The SB3 includes the tested Text Lines JavaScript so TurboWarp can offer the
|
|
36
|
+
unsandboxed permission checkbox. Reopening the downloaded SB3 needs no extra JS download.
|
|
37
|
+
Edit the first `set Input text` block to try other text.
|
|
38
|
+
|
|
39
|
+
Sources: [`samples/lines-to-list/project.json`](samples/lines-to-list/project.json).
|
|
40
|
+
Rebuild with `pnpm run samples:build`; check committed archives with
|
|
41
|
+
`pnpm run samples:check`. `pnpm run pages:build` stages documentation, `dist/`, and
|
|
42
|
+
samples under `_site/` for GitHub Pages. See [sample maintenance](samples/README.md).
|
|
43
|
+
|
|
26
44
|
## See it in action
|
|
27
45
|
|
|
28
46
|
Start with this text:
|
package/dist/text-lines.js
CHANGED
|
@@ -21,7 +21,7 @@ var extensionConfig = {
|
|
|
21
21
|
blockIconURI: `data:image/svg+xml,${encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><g fill=\"#4C97FF\"><circle cx=\"11\" cy=\"16\" r=\"2.6\"/><circle cx=\"11\" cy=\"24\" r=\"2.6\"/><circle cx=\"11\" cy=\"32\" r=\"2.6\"/></g><path d=\"M19 16h20M19 24h20M19 32h13\" fill=\"none\" stroke=\"#59C059\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>")}`
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.
|
|
24
|
+
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.5.0_react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/fixed-input-schema.js
|
|
25
25
|
var numberToken = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u;
|
|
26
26
|
var invalidNumber = Object.freeze({
|
|
27
27
|
kind: "invalid",
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-text-lines",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Use multiline text in TurboWarp projects with line counting, lookup, and list-writing blocks.",
|
|
5
|
-
"author":
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Hiroya Kubo",
|
|
7
|
+
"email": "hiroya@cuc.ac.jp",
|
|
8
|
+
"url": "https://github.com/kubohiroya"
|
|
9
|
+
},
|
|
6
10
|
"license": "MPL-2.0",
|
|
7
11
|
"homepage": "https://github.com/kubohiroya/turbowarp-text-lines#readme",
|
|
8
12
|
"repository": {
|
|
@@ -47,15 +51,18 @@
|
|
|
47
51
|
"check:dist": "pnpm run build && git diff --exit-code -- dist",
|
|
48
52
|
"repo:check": "node scripts/check-repo.ts",
|
|
49
53
|
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
50
|
-
"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"
|
|
54
|
+
"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 && pnpm run samples:check",
|
|
55
|
+
"samples:build": "node scripts/build-samples.mjs",
|
|
56
|
+
"samples:check": "node scripts/build-samples.mjs --check && node --test scripts/verify-samples.mjs",
|
|
57
|
+
"pages:build": "node scripts/prepare-pages.mjs"
|
|
51
58
|
},
|
|
52
59
|
"devDependencies": {
|
|
53
|
-
"@kubohiroya/vite-plugin-turbowarp-extension": "^0.
|
|
60
|
+
"@kubohiroya/vite-plugin-turbowarp-extension": "^0.10.0",
|
|
54
61
|
"@types/node": "^22.20.1",
|
|
55
62
|
"typescript": "^5.9.3",
|
|
56
63
|
"vite": "^8.2.2",
|
|
57
64
|
"vitest": "^4.1.10",
|
|
58
|
-
"@kubohiroya/turbowarp-extension-data-editor": "^0.
|
|
65
|
+
"@kubohiroya/turbowarp-extension-data-editor": "^0.5.0"
|
|
59
66
|
},
|
|
60
67
|
"gitHead": "86365d0f44d92bcf6ad828be8d165e4852abd7f4",
|
|
61
68
|
"x-turbowarp-source": {
|