nadesiko3 3.7.20 → 3.7.22
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/batch/command.txt +483 -445
- package/batch/jsplugin2text.nako3 +1 -1
- package/batch/pickup_command.nako3 +12 -0
- package/core/command/snako.mts +5 -1
- package/core/deno/snako.ts +5 -1
- package/core/package-lock.json +382 -21
- package/core/package.json +4 -4
- package/core/src/README.md +98 -0
- package/core/src/nako3.mts +178 -614
- package/core/src/nako_basic_plugins.mts +39 -0
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mts +0 -1
- package/core/src/nako_event.mts +49 -0
- package/core/src/nako_gen.mts +291 -202
- package/core/src/nako_indent_inline.mts +2 -2
- package/core/src/nako_lex_rules.mts +1 -1
- package/core/src/nako_parser3.mts +106 -165
- package/core/src/nako_parser_async.mts +97 -0
- package/core/src/nako_parser_base.mts +4 -55
- package/core/src/nako_parser_message.mts +105 -0
- package/core/src/nako_parser_operator.mts +93 -0
- package/core/src/nako_plugin_manager.mts +260 -0
- package/core/src/nako_require.mts +292 -0
- package/core/src/nako_runner.mts +191 -0
- package/core/src/nako_tokenizer.mts +221 -0
- package/core/src/plugin_csv.mts +1 -1
- package/core/src/plugin_system.mts +34 -3259
- package/core/src/plugin_system_array.mts +699 -0
- package/core/src/plugin_system_datetime.mts +368 -0
- package/core/src/plugin_system_debug.mts +403 -0
- package/core/src/plugin_system_dict.mts +85 -0
- package/core/src/plugin_system_json.mts +73 -0
- package/core/src/plugin_system_math.mts +383 -0
- package/core/src/plugin_system_regexp.mts +120 -0
- package/core/src/plugin_system_stdio.mts +86 -0
- package/core/src/plugin_system_string.mts +666 -0
- package/core/src/plugin_system_timer.mts +152 -0
- package/core/src/plugin_system_types.mts +151 -0
- package/core/src/plugin_system_url.mts +193 -0
- package/core/src/plugin_toml.mts +3 -3
- package/core/test/fixtures/README.md +39 -0
- package/core/test/fixtures/make_parser_ast_golden.mjs +31 -0
- package/core/test/fixtures/parser_ast_golden.json +8027 -0
- package/core/test/fixtures/parser_corpus.mjs +120 -0
- package/core/test/indent_test.mjs +6 -0
- package/core/test/nako_basic_plugins_test.mjs +44 -0
- package/core/test/nako_event_test.mjs +85 -0
- package/core/test/nako_gen_perf_test.mjs +178 -0
- package/core/test/nako_parser_async_test.mjs +112 -0
- package/core/test/nako_parser_test.mjs +160 -0
- package/core/test/nako_plugin_manager_test.mjs +185 -0
- package/core/test/nako_require_test.mjs +153 -0
- package/core/test/nako_runner_test.mjs +114 -0
- package/core/test/nako_tokenizer_test.mjs +115 -0
- package/core/test/plugin_system_debug_test.mjs +141 -0
- package/core/test/plugin_system_split_test.mjs +179 -0
- package/core/test/plugin_system_test.mjs +6 -0
- package/core/tsconfig.json +0 -1
- package/package.json +24 -34
- package/release/_hash.txt +40 -40
- package/release/_script-tags.txt +16 -16
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/edit_main.js +6 -6
- package/release/edit_main.js.map +3 -3
- package/release/editor.js +6 -6
- package/release/plugin_datetime.js +1 -1
- package/release/plugin_datetime.js.map +3 -3
- package/release/plugin_keigo.js.map +3 -3
- package/release/plugin_markup.js +47 -47
- package/release/plugin_markup.js.map +3 -3
- package/release/plugin_weykturtle3d.js +1 -1
- package/release/plugin_weykturtle3d.js.map +3 -3
- package/release/version.js +2 -2
- package/release/version_main.js +2 -2
- package/release/version_main.js.map +2 -2
- package/release/wnako3.js +187 -214
- package/release/wnako3.js.map +4 -4
- package/release/wnako3webworker.js +172 -199
- package/release/wnako3webworker.js.map +4 -4
- package/src/cnako3mod.mjs +8 -4
- package/src/cnako3mod.mts +8 -4
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser_ajax.mjs +4 -4
- package/src/plugin_browser_ajax.mts +4 -4
- package/src/plugin_browser_audio.mjs +10 -10
- package/src/plugin_browser_audio.mts +10 -10
- package/src/plugin_browser_camera.mjs +4 -4
- package/src/plugin_browser_camera.mts +4 -4
- package/src/plugin_browser_canvas.mjs +2 -2
- package/src/plugin_browser_canvas.mts +2 -2
- package/src/plugin_browser_crypto.mjs +3 -3
- package/src/plugin_browser_crypto.mts +3 -3
- package/src/plugin_browser_dom_event.mjs +1 -1
- package/src/plugin_browser_dom_event.mts +1 -1
- package/src/plugin_browser_geolocation.mjs +1 -1
- package/src/plugin_browser_geolocation.mts +1 -1
- package/src/plugin_browser_hotkey.mjs +1 -1
- package/src/plugin_browser_hotkey.mts +1 -1
- package/src/plugin_browser_html.mjs +1 -1
- package/src/plugin_browser_html.mts +1 -1
- package/src/plugin_browser_location.mjs +1 -1
- package/src/plugin_browser_location.mts +1 -1
- package/src/plugin_browser_speech.mjs +1 -1
- package/src/plugin_browser_speech.mts +1 -1
- package/src/plugin_browser_storage.mjs +2 -2
- package/src/plugin_browser_storage.mts +2 -2
- package/src/plugin_httpserver.mjs +186 -15
- package/src/plugin_httpserver.mts +178 -12
- package/src/plugin_keigo.mjs +2 -2
- package/src/plugin_keigo.mts +2 -2
- package/src/plugin_node.mjs +48 -49
- package/src/plugin_node.mts +53 -54
- package/src/plugin_weykturtle3d.mjs +56 -56
- package/src/plugin_weykturtle3d.mts +56 -56
- package/src/wnako3.mjs +1 -1
- package/src/wnako3.mts +1 -1
- package/src/wnako3_editor.mjs +5 -5
- package/src/wnako3_editor.mts +5 -5
- package/src/wnako3mod.mjs +5 -2
- package/src/wnako3mod.mts +5 -2
- package/test/common/wnako3mod_test.mjs +48 -0
- package/test/node/package_json_test.mjs +17 -0
- package/test/node/plugin_httpserver_test.mjs +239 -0
- package/tools/nako3server/index.nako3 +4 -2
- package/core/src/nako3.mjs +0 -1021
- package/core/src/nako_ast.mjs +0 -4
- package/core/src/nako_colors.mjs +0 -77
- package/core/src/nako_core_version.mjs +0 -8
- package/core/src/nako_csv.mjs +0 -193
- package/core/src/nako_errors.mjs +0 -166
- package/core/src/nako_from_dncl.mjs +0 -285
- package/core/src/nako_from_dncl2.mjs +0 -347
- package/core/src/nako_gen.mjs +0 -2500
- package/core/src/nako_global.mjs +0 -138
- package/core/src/nako_indent.mjs +0 -442
- package/core/src/nako_indent_chars.mjs +0 -29
- package/core/src/nako_indent_inline.mjs +0 -361
- package/core/src/nako_josi_list.mjs +0 -47
- package/core/src/nako_lex_rules.mjs +0 -319
- package/core/src/nako_lexer.mjs +0 -794
- package/core/src/nako_logger.mjs +0 -221
- package/core/src/nako_parser3.mjs +0 -3250
- package/core/src/nako_parser_base.mjs +0 -403
- package/core/src/nako_parser_const.mjs +0 -37
- package/core/src/nako_prepare.mjs +0 -329
- package/core/src/nako_reserved_words.mjs +0 -42
- package/core/src/nako_source_mapping.mjs +0 -207
- package/core/src/nako_test.mjs +0 -37
- package/core/src/nako_token.mjs +0 -1
- package/core/src/nako_tools.mjs +0 -53
- package/core/src/nako_types.mjs +0 -14
- package/core/src/plugin_api.mjs +0 -4
- package/core/src/plugin_csv.mjs +0 -97
- package/core/src/plugin_math.mjs +0 -352
- package/core/src/plugin_promise.mjs +0 -102
- package/core/src/plugin_system.mjs +0 -3810
- package/core/src/plugin_test.mjs +0 -52
- package/core/src/plugin_toml.mjs +0 -39
package/src/cnako3mod.mjs
CHANGED
|
@@ -8,7 +8,6 @@ import { exec } from 'node:child_process';
|
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import url from 'node:url';
|
|
10
10
|
import fse from 'fs-extra';
|
|
11
|
-
import fetch from 'node-fetch';
|
|
12
11
|
import { NakoCompiler, newCompilerOptions } from '../core/src/nako3.mjs';
|
|
13
12
|
import { NakoImportError } from '../core/src/nako_errors.mjs';
|
|
14
13
|
import { NakoGenOptions } from '../core/src/nako_gen.mjs';
|
|
@@ -230,15 +229,20 @@ export class CNako3 extends NakoCompiler {
|
|
|
230
229
|
}
|
|
231
230
|
// from nadesiko3core/src
|
|
232
231
|
const srcDir = path.join(__dirname, '..', 'core', 'src');
|
|
232
|
+
// plugin_system_*.mjs は plugin_system.mjs から読み込まれるためコピーが必要 #2351
|
|
233
233
|
const baseFiles = ['nako_errors.mjs', 'nako_core_version.mjs',
|
|
234
|
-
'plugin_system.mjs', '
|
|
234
|
+
'plugin_system.mjs', 'plugin_system_debug.mjs', 'plugin_system_math.mjs', 'plugin_system_string.mjs',
|
|
235
|
+
'plugin_system_array.mjs', 'plugin_system_datetime.mjs', 'plugin_system_url.mjs',
|
|
236
|
+
'plugin_system_types.mjs', 'plugin_system_json.mjs', 'plugin_system_regexp.mjs', 'plugin_system_dict.mjs',
|
|
237
|
+
'plugin_system_stdio.mjs', 'plugin_system_timer.mjs',
|
|
238
|
+
'plugin_math.mjs', 'plugin_promise.mjs', 'plugin_test.mjs', 'plugin_csv.mjs', 'nako_csv.mjs'];
|
|
235
239
|
for (const mod of baseFiles) {
|
|
236
240
|
fs.copyFileSync(path.join(srcDir, mod), path.join(outRuntime, mod));
|
|
237
241
|
}
|
|
238
242
|
// or 以下のコピーだと依存ファイルがコピーされない package.jsonを見てコピーする必要がある
|
|
239
243
|
const orgModule = path.join(__dirname, '..', 'node_modules');
|
|
240
244
|
const dirNodeModules = path.join(path.dirname(opt.output), 'node_modules');
|
|
241
|
-
const modlist = ['fs-extra', 'iconv-lite', 'opener', '
|
|
245
|
+
const modlist = ['fs-extra', 'iconv-lite', 'opener', 'shell-quote'];
|
|
242
246
|
const copied = {};
|
|
243
247
|
// 再帰的に必要なモジュールをコピーする
|
|
244
248
|
const copyModule = (mod) => {
|
|
@@ -568,7 +572,7 @@ export class CNako3 extends NakoCompiler {
|
|
|
568
572
|
cachePath[f] = b;
|
|
569
573
|
return b;
|
|
570
574
|
}
|
|
571
|
-
catch
|
|
575
|
+
catch {
|
|
572
576
|
return false;
|
|
573
577
|
}
|
|
574
578
|
};
|
package/src/cnako3mod.mts
CHANGED
|
@@ -11,7 +11,6 @@ import path from 'node:path'
|
|
|
11
11
|
import url from 'node:url'
|
|
12
12
|
import fse from 'fs-extra'
|
|
13
13
|
|
|
14
|
-
import fetch from 'node-fetch'
|
|
15
14
|
import { NakoCompiler, LoaderTool, newCompilerOptions } from '../core/src/nako3.mjs'
|
|
16
15
|
import { NakoImportError } from '../core/src/nako_errors.mjs'
|
|
17
16
|
|
|
@@ -270,15 +269,20 @@ export class CNako3 extends NakoCompiler {
|
|
|
270
269
|
}
|
|
271
270
|
// from nadesiko3core/src
|
|
272
271
|
const srcDir = path.join(__dirname, '..', 'core', 'src')
|
|
272
|
+
// plugin_system_*.mjs は plugin_system.mjs から読み込まれるためコピーが必要 #2351
|
|
273
273
|
const baseFiles = ['nako_errors.mjs', 'nako_core_version.mjs',
|
|
274
|
-
'plugin_system.mjs', '
|
|
274
|
+
'plugin_system.mjs', 'plugin_system_debug.mjs', 'plugin_system_math.mjs', 'plugin_system_string.mjs',
|
|
275
|
+
'plugin_system_array.mjs', 'plugin_system_datetime.mjs', 'plugin_system_url.mjs',
|
|
276
|
+
'plugin_system_types.mjs', 'plugin_system_json.mjs', 'plugin_system_regexp.mjs', 'plugin_system_dict.mjs',
|
|
277
|
+
'plugin_system_stdio.mjs', 'plugin_system_timer.mjs',
|
|
278
|
+
'plugin_math.mjs', 'plugin_promise.mjs', 'plugin_test.mjs', 'plugin_csv.mjs', 'nako_csv.mjs']
|
|
275
279
|
for (const mod of baseFiles) {
|
|
276
280
|
fs.copyFileSync(path.join(srcDir, mod), path.join(outRuntime, mod))
|
|
277
281
|
}
|
|
278
282
|
// or 以下のコピーだと依存ファイルがコピーされない package.jsonを見てコピーする必要がある
|
|
279
283
|
const orgModule = path.join(__dirname, '..', 'node_modules')
|
|
280
284
|
const dirNodeModules = path.join(path.dirname(opt.output), 'node_modules')
|
|
281
|
-
const modlist = ['fs-extra', 'iconv-lite', 'opener', '
|
|
285
|
+
const modlist = ['fs-extra', 'iconv-lite', 'opener', 'shell-quote']
|
|
282
286
|
const copied: { [key: string]: boolean } = {}
|
|
283
287
|
// 再帰的に必要なモジュールをコピーする
|
|
284
288
|
const copyModule = (mod: string) => {
|
|
@@ -600,7 +604,7 @@ export class CNako3 extends NakoCompiler {
|
|
|
600
604
|
cachePath[f] = b
|
|
601
605
|
return b
|
|
602
606
|
|
|
603
|
-
} catch
|
|
607
|
+
} catch {
|
|
604
608
|
return false
|
|
605
609
|
}
|
|
606
610
|
}
|
package/src/nako_version.mjs
CHANGED
package/src/nako_version.mts
CHANGED
|
@@ -209,7 +209,7 @@ export default {
|
|
|
209
209
|
type: 'func',
|
|
210
210
|
josi: [['の', 'を']],
|
|
211
211
|
pure: true,
|
|
212
|
-
fn: function (params,
|
|
212
|
+
fn: function (params, _sys) {
|
|
213
213
|
const flist = [];
|
|
214
214
|
for (const key in params) {
|
|
215
215
|
const v = params[key];
|
|
@@ -249,7 +249,7 @@ export default {
|
|
|
249
249
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
250
250
|
pure: true,
|
|
251
251
|
asyncFn: true,
|
|
252
|
-
fn: function (url, params,
|
|
252
|
+
fn: function (url, params, _sys) {
|
|
253
253
|
return new Promise((resolve, reject) => {
|
|
254
254
|
const fd = new FormData();
|
|
255
255
|
for (const key in params) {
|
|
@@ -313,7 +313,7 @@ export default {
|
|
|
313
313
|
type: 'func',
|
|
314
314
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
315
315
|
pure: true,
|
|
316
|
-
fn: function (url, params,
|
|
316
|
+
fn: function (url, params, _sys) {
|
|
317
317
|
const fd = new FormData();
|
|
318
318
|
for (const key in params) {
|
|
319
319
|
fd.set(key, params[key]);
|
|
@@ -330,7 +330,7 @@ export default {
|
|
|
330
330
|
type: 'func',
|
|
331
331
|
josi: [['から'], ['で']],
|
|
332
332
|
pure: true,
|
|
333
|
-
fn: function (res, type,
|
|
333
|
+
fn: function (res, type, _sys) {
|
|
334
334
|
type = type.toString().toUpperCase();
|
|
335
335
|
if (type === 'TEXT' || type === 'テキスト') {
|
|
336
336
|
return res.text();
|
|
@@ -200,7 +200,7 @@ export default {
|
|
|
200
200
|
type: 'func',
|
|
201
201
|
josi: [['の', 'を']],
|
|
202
202
|
pure: true,
|
|
203
|
-
fn: function(params: any,
|
|
203
|
+
fn: function(params: any, _sys: any) {
|
|
204
204
|
const flist: string[] = []
|
|
205
205
|
for (const key in params) {
|
|
206
206
|
const v = params[key]
|
|
@@ -240,7 +240,7 @@ export default {
|
|
|
240
240
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
241
241
|
pure: true,
|
|
242
242
|
asyncFn: true,
|
|
243
|
-
fn: function(url: any, params: any,
|
|
243
|
+
fn: function(url: any, params: any, _sys: any) {
|
|
244
244
|
return new Promise((resolve, reject) => {
|
|
245
245
|
const fd = new FormData()
|
|
246
246
|
for (const key in params) { fd.set(key, params[key]) }
|
|
@@ -300,7 +300,7 @@ export default {
|
|
|
300
300
|
type: 'func',
|
|
301
301
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
302
302
|
pure: true,
|
|
303
|
-
fn: function(url: any, params: any,
|
|
303
|
+
fn: function(url: any, params: any, _sys: any) {
|
|
304
304
|
const fd = new FormData()
|
|
305
305
|
for (const key in params) { fd.set(key, params[key]) }
|
|
306
306
|
|
|
@@ -316,7 +316,7 @@ export default {
|
|
|
316
316
|
type: 'func',
|
|
317
317
|
josi: [['から'], ['で']],
|
|
318
318
|
pure: true,
|
|
319
|
-
fn: function(res: any, type: any,
|
|
319
|
+
fn: function(res: any, type: any, _sys: any) {
|
|
320
320
|
type = type.toString().toUpperCase()
|
|
321
321
|
if (type === 'TEXT' || type === 'テキスト') {
|
|
322
322
|
return res.text()
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
type: 'func',
|
|
5
5
|
josi: [['を', 'の']],
|
|
6
6
|
pure: true,
|
|
7
|
-
fn: function (url,
|
|
7
|
+
fn: function (url, _sys) {
|
|
8
8
|
const a = new Audio();
|
|
9
9
|
a.src = url;
|
|
10
10
|
return a;
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
type: 'func',
|
|
16
16
|
josi: [['を']],
|
|
17
17
|
pure: true,
|
|
18
|
-
fn: function (obj,
|
|
18
|
+
fn: function (obj, _sys) {
|
|
19
19
|
if (!obj) {
|
|
20
20
|
throw new Error('オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
21
21
|
}
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
type: 'func',
|
|
29
29
|
josi: [['を']],
|
|
30
30
|
pure: true,
|
|
31
|
-
fn: function (obj,
|
|
31
|
+
fn: function (obj, _sys) {
|
|
32
32
|
if (!obj) {
|
|
33
33
|
throw new Error('オーディオループ再生する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
34
34
|
}
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
type: 'func',
|
|
42
42
|
josi: [['を']],
|
|
43
43
|
pure: true,
|
|
44
|
-
fn: function (obj,
|
|
44
|
+
fn: function (obj, _sys) {
|
|
45
45
|
if (!obj) {
|
|
46
46
|
throw new Error('オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
47
47
|
}
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
type: 'func',
|
|
59
59
|
josi: [['を']],
|
|
60
60
|
pure: true,
|
|
61
|
-
fn: function (obj,
|
|
61
|
+
fn: function (obj, _sys) {
|
|
62
62
|
if (!obj) {
|
|
63
63
|
throw new Error('オーディオ一時停止する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
64
64
|
}
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
type: 'func',
|
|
71
71
|
josi: [['の', 'から']],
|
|
72
72
|
pure: true,
|
|
73
|
-
fn: function (obj,
|
|
73
|
+
fn: function (obj, _sys) {
|
|
74
74
|
if (!obj) {
|
|
75
75
|
throw new Error('オーディオ音量取得する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
76
76
|
}
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
type: 'func',
|
|
82
82
|
josi: [['を'], ['に', 'へ']],
|
|
83
83
|
pure: true,
|
|
84
|
-
fn: function (obj, v,
|
|
84
|
+
fn: function (obj, v, _sys) {
|
|
85
85
|
if (!obj) {
|
|
86
86
|
throw new Error('オーディオ音量設定する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
87
87
|
}
|
|
@@ -93,7 +93,7 @@ export default {
|
|
|
93
93
|
type: 'func',
|
|
94
94
|
josi: [['の', 'から']],
|
|
95
95
|
pure: true,
|
|
96
|
-
fn: function (obj,
|
|
96
|
+
fn: function (obj, _sys) {
|
|
97
97
|
if (!obj) {
|
|
98
98
|
throw new Error('オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
99
99
|
}
|
|
@@ -104,7 +104,7 @@ export default {
|
|
|
104
104
|
type: 'func',
|
|
105
105
|
josi: [['の', 'から']],
|
|
106
106
|
pure: true,
|
|
107
|
-
fn: function (obj,
|
|
107
|
+
fn: function (obj, _sys) {
|
|
108
108
|
if (!obj) {
|
|
109
109
|
throw new Error('オーディオ再生位置取得する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
110
110
|
}
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
115
115
|
type: 'func',
|
|
116
116
|
josi: [['を'], ['に', 'へ']],
|
|
117
117
|
pure: true,
|
|
118
|
-
fn: function (obj, v,
|
|
118
|
+
fn: function (obj, v, _sys) {
|
|
119
119
|
if (!obj) {
|
|
120
120
|
throw new Error('オーディオ再生位置設定する前に、オーディオ開くで音声ファイルを読み込んでください');
|
|
121
121
|
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
type: 'func',
|
|
6
6
|
josi: [['を', 'の']],
|
|
7
7
|
pure: true,
|
|
8
|
-
fn: function(url: any,
|
|
8
|
+
fn: function(url: any, _sys: any) {
|
|
9
9
|
const a = new Audio()
|
|
10
10
|
a.src = url
|
|
11
11
|
return a
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
type: 'func',
|
|
17
17
|
josi: [['を']],
|
|
18
18
|
pure: true,
|
|
19
|
-
fn: function(obj: any,
|
|
19
|
+
fn: function(obj: any, _sys: any) {
|
|
20
20
|
if (!obj) { throw new Error('オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
21
21
|
obj.loop = false
|
|
22
22
|
obj.play()
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
type: 'func',
|
|
28
28
|
josi: [['を']],
|
|
29
29
|
pure: true,
|
|
30
|
-
fn: function(obj: any,
|
|
30
|
+
fn: function(obj: any, _sys: any) {
|
|
31
31
|
if (!obj) { throw new Error('オーディオループ再生する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
32
32
|
obj.loop = true
|
|
33
33
|
obj.play()
|
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
type: 'func',
|
|
39
39
|
josi: [['を']],
|
|
40
40
|
pure: true,
|
|
41
|
-
fn: function(obj: any,
|
|
41
|
+
fn: function(obj: any, _sys: any) {
|
|
42
42
|
if (!obj) { throw new Error('オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
43
43
|
obj.pause()
|
|
44
44
|
obj.currentTime = 0 // 暫定
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
type: 'func',
|
|
54
54
|
josi: [['を']],
|
|
55
55
|
pure: true,
|
|
56
|
-
fn: function(obj: any,
|
|
56
|
+
fn: function(obj: any, _sys: any) {
|
|
57
57
|
if (!obj) { throw new Error('オーディオ一時停止する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
58
58
|
obj.pause()
|
|
59
59
|
},
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
type: 'func',
|
|
64
64
|
josi: [['の', 'から']],
|
|
65
65
|
pure: true,
|
|
66
|
-
fn: function(obj: any,
|
|
66
|
+
fn: function(obj: any, _sys: any) {
|
|
67
67
|
if (!obj) { throw new Error('オーディオ音量取得する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
68
68
|
return obj.volume
|
|
69
69
|
}
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
type: 'func',
|
|
73
73
|
josi: [['を'], ['に', 'へ']],
|
|
74
74
|
pure: true,
|
|
75
|
-
fn: function(obj: any, v: any,
|
|
75
|
+
fn: function(obj: any, v: any, _sys: any) {
|
|
76
76
|
if (!obj) { throw new Error('オーディオ音量設定する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
77
77
|
obj.volume = v
|
|
78
78
|
},
|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
type: 'func',
|
|
83
83
|
josi: [['の', 'から']],
|
|
84
84
|
pure: true,
|
|
85
|
-
fn: function(obj: any,
|
|
85
|
+
fn: function(obj: any, _sys: any) {
|
|
86
86
|
if (!obj) { throw new Error('オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
87
87
|
return obj.duration
|
|
88
88
|
}
|
|
@@ -91,7 +91,7 @@ export default {
|
|
|
91
91
|
type: 'func',
|
|
92
92
|
josi: [['の', 'から']],
|
|
93
93
|
pure: true,
|
|
94
|
-
fn: function(obj: any,
|
|
94
|
+
fn: function(obj: any, _sys: any) {
|
|
95
95
|
if (!obj) { throw new Error('オーディオ再生位置取得する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
96
96
|
return obj.currentTime
|
|
97
97
|
}
|
|
@@ -100,7 +100,7 @@ export default {
|
|
|
100
100
|
type: 'func',
|
|
101
101
|
josi: [['を'], ['に', 'へ']],
|
|
102
102
|
pure: true,
|
|
103
|
-
fn: function(obj: any, v: any,
|
|
103
|
+
fn: function(obj: any, v: any, _sys: any) {
|
|
104
104
|
if (!obj) { throw new Error('オーディオ再生位置設定する前に、オーディオ開くで音声ファイルを読み込んでください') }
|
|
105
105
|
obj.currentTime = v
|
|
106
106
|
},
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
type: 'func',
|
|
42
42
|
josi: [['の']],
|
|
43
43
|
pure: true,
|
|
44
|
-
fn: function (v,
|
|
44
|
+
fn: function (v, _sys) {
|
|
45
45
|
if (v && v.play) {
|
|
46
46
|
v.play();
|
|
47
47
|
}
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
type: 'func',
|
|
53
53
|
josi: [['の']],
|
|
54
54
|
pure: true,
|
|
55
|
-
fn: function (v,
|
|
55
|
+
fn: function (v, _sys) {
|
|
56
56
|
if (v && v.pause) {
|
|
57
57
|
v.pause();
|
|
58
58
|
}
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
type: 'func',
|
|
64
64
|
josi: [['の']],
|
|
65
65
|
pure: true,
|
|
66
|
-
fn: function (v,
|
|
66
|
+
fn: function (v, _sys) {
|
|
67
67
|
if (v && v.srcObject && v.srcObject.getVideoTracks) {
|
|
68
68
|
const tracks = v.srcObject.getVideoTracks();
|
|
69
69
|
if (tracks.length > 0) {
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
type: 'func',
|
|
93
93
|
josi: [['の']],
|
|
94
94
|
pure: true,
|
|
95
|
-
fn: function (v,
|
|
95
|
+
fn: function (v, _sys) {
|
|
96
96
|
if (v && v.srcObject && v.srcObject.getVideoTracks) {
|
|
97
97
|
const tracks = v.srcObject.getVideoTracks();
|
|
98
98
|
for (const track of tracks) {
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
type: 'func',
|
|
45
45
|
josi: [['の']],
|
|
46
46
|
pure: true,
|
|
47
|
-
fn: function(v: any,
|
|
47
|
+
fn: function(v: any, _sys: NakoSystem) {
|
|
48
48
|
if (v && v.play) {
|
|
49
49
|
v.play()
|
|
50
50
|
}
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
type: 'func',
|
|
56
56
|
josi: [['の']],
|
|
57
57
|
pure: true,
|
|
58
|
-
fn: function(v: any,
|
|
58
|
+
fn: function(v: any, _sys: NakoSystem) {
|
|
59
59
|
if (v && v.pause) {
|
|
60
60
|
v.pause()
|
|
61
61
|
}
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
66
66
|
type: 'func',
|
|
67
67
|
josi: [['の']],
|
|
68
68
|
pure: true,
|
|
69
|
-
fn: function(v: any,
|
|
69
|
+
fn: function(v: any, _sys: NakoSystem) {
|
|
70
70
|
if (v && v.srcObject && v.srcObject.getVideoTracks) {
|
|
71
71
|
const tracks = v.srcObject.getVideoTracks()
|
|
72
72
|
if (tracks.length > 0) {
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
95
95
|
type: 'func',
|
|
96
96
|
josi: [['の']],
|
|
97
97
|
pure: true,
|
|
98
|
-
fn: function(v:any,
|
|
98
|
+
fn: function(v:any, _sys: NakoSystem) {
|
|
99
99
|
if (v && v.srcObject && v.srcObject.getVideoTracks) {
|
|
100
100
|
const tracks = v.srcObject.getVideoTracks()
|
|
101
101
|
for (const track of tracks) {
|
|
@@ -257,7 +257,7 @@ export default {
|
|
|
257
257
|
type: 'func',
|
|
258
258
|
josi: [['の', 'を']],
|
|
259
259
|
pure: true,
|
|
260
|
-
fn: function (url,
|
|
260
|
+
fn: function (url, _sys) {
|
|
261
261
|
const img = new window.Image();
|
|
262
262
|
img.src = url;
|
|
263
263
|
img.crossOrigin = 'Anonymous';
|
|
@@ -544,7 +544,7 @@ export default {
|
|
|
544
544
|
pure: true,
|
|
545
545
|
asyncFn: true,
|
|
546
546
|
fn: function (sys) {
|
|
547
|
-
return new Promise((resolve,
|
|
547
|
+
return new Promise((resolve, _reject) => {
|
|
548
548
|
const cv = sys.__getSysVar('描画中キャンバス');
|
|
549
549
|
cv.toBlob((result) => { resolve(result); }, 'image/png');
|
|
550
550
|
});
|
|
@@ -199,7 +199,7 @@ export default {
|
|
|
199
199
|
type: 'func',
|
|
200
200
|
josi: [['の', 'を']],
|
|
201
201
|
pure: true,
|
|
202
|
-
fn: function(url: any,
|
|
202
|
+
fn: function(url: any, _sys: any) {
|
|
203
203
|
const img = new window.Image()
|
|
204
204
|
img.src = url
|
|
205
205
|
img.crossOrigin = 'Anonymous'
|
|
@@ -451,7 +451,7 @@ export default {
|
|
|
451
451
|
pure: true,
|
|
452
452
|
asyncFn: true,
|
|
453
453
|
fn: function(sys: any) {
|
|
454
|
-
return new Promise((resolve,
|
|
454
|
+
return new Promise((resolve, _reject) => {
|
|
455
455
|
const cv = sys.__getSysVar('描画中キャンバス')
|
|
456
456
|
cv.toBlob((result: any) => { resolve(result) }, 'image/png')
|
|
457
457
|
})
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
josi: [['を'], ['で']],
|
|
26
26
|
pure: true,
|
|
27
27
|
asyncFn: true,
|
|
28
|
-
fn: async function (s, alg,
|
|
28
|
+
fn: async function (s, alg, _sys) {
|
|
29
29
|
const msgUint8 = new TextEncoder().encode(s); // (utf-8 の) Uint8Array にエンコードする
|
|
30
30
|
const hashBuffer = await crypto.subtle.digest(alg, msgUint8);
|
|
31
31
|
const hashArray = Array.from(new Uint8Array(hashBuffer)); // バッファーをバイト列に変換する
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
type: 'func',
|
|
40
40
|
josi: [],
|
|
41
41
|
pure: true,
|
|
42
|
-
fn: function (
|
|
42
|
+
fn: function (_sys) {
|
|
43
43
|
return window.crypto.randomUUID();
|
|
44
44
|
}
|
|
45
45
|
},
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
type: 'func',
|
|
48
48
|
josi: [['の']],
|
|
49
49
|
pure: true,
|
|
50
|
-
fn: function (cnt,
|
|
50
|
+
fn: function (cnt, _sys) {
|
|
51
51
|
const array = new Uint8Array(cnt);
|
|
52
52
|
window.crypto.getRandomValues(array);
|
|
53
53
|
return array;
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
josi: [['を'], ['で']],
|
|
26
26
|
pure: true,
|
|
27
27
|
asyncFn: true,
|
|
28
|
-
fn: async function(s: string, alg: string,
|
|
28
|
+
fn: async function(s: string, alg: string, _sys: any) {
|
|
29
29
|
const msgUint8 = new TextEncoder().encode(s) // (utf-8 の) Uint8Array にエンコードする
|
|
30
30
|
const hashBuffer = await crypto.subtle.digest(alg, msgUint8)
|
|
31
31
|
const hashArray = Array.from(new Uint8Array(hashBuffer)) // バッファーをバイト列に変換する
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
type: 'func',
|
|
40
40
|
josi: [],
|
|
41
41
|
pure: true,
|
|
42
|
-
fn: function(
|
|
42
|
+
fn: function(_sys: any) {
|
|
43
43
|
return window.crypto.randomUUID()
|
|
44
44
|
}
|
|
45
45
|
},
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
type: 'func',
|
|
48
48
|
josi: [['の']],
|
|
49
49
|
pure: true,
|
|
50
|
-
fn: function(cnt: number,
|
|
50
|
+
fn: function(cnt: number, _sys: any) {
|
|
51
51
|
const array = new Uint8Array(cnt)
|
|
52
52
|
window.crypto.getRandomValues(array)
|
|
53
53
|
return array
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
type: 'func',
|
|
33
33
|
josi: [['を', 'の']],
|
|
34
34
|
pure: true,
|
|
35
|
-
fn: function (event,
|
|
35
|
+
fn: function (event, _sys) {
|
|
36
36
|
if (event !== null && typeof event === 'object' && 'preventDefault' in event) {
|
|
37
37
|
const objWithFn = event;
|
|
38
38
|
if (typeof objWithFn.preventDefault === 'function') {
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
type: 'func',
|
|
36
36
|
josi: [['を', 'の']],
|
|
37
37
|
pure: true,
|
|
38
|
-
fn: function(event: unknown,
|
|
38
|
+
fn: function(event: unknown, _sys: NakoBrowsesrSystem) {
|
|
39
39
|
if (event !== null && typeof event === 'object' && 'preventDefault' in event) {
|
|
40
40
|
const objWithFn = event as { preventDefault: () => void }
|
|
41
41
|
if (typeof objWithFn.preventDefault === 'function') {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
josi: [['に', 'で'], ['を']],
|
|
9
9
|
pure: true,
|
|
10
10
|
fn: function(key: any, fname: any, sys: any) {
|
|
11
|
-
hotkeys(key, function(event: any,
|
|
11
|
+
hotkeys(key, function(event: any, _handler: any) {
|
|
12
12
|
event.preventDefault()
|
|
13
13
|
const f = sys.__findFunc(fname)
|
|
14
14
|
f(sys)
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
type: 'func',
|
|
69
69
|
josi: [],
|
|
70
70
|
pure: true,
|
|
71
|
-
fn: function(
|
|
71
|
+
fn: function(_sys: any) {
|
|
72
72
|
// 対応している?
|
|
73
73
|
if (!('SpeechSynthesisUtterance' in window)) { throw new Error('音声合成APIに対応していません') }
|
|
74
74
|
return window.speechSynthesis.getVoices()
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
66
66
|
try {
|
|
67
67
|
return JSON.parse(v);
|
|
68
68
|
}
|
|
69
|
-
catch
|
|
69
|
+
catch {
|
|
70
70
|
console.log('ローカルストレージ『' + key + '』の読み込みに失敗');
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
type: 'func',
|
|
79
79
|
josi: [],
|
|
80
80
|
pure: true,
|
|
81
|
-
fn: function (
|
|
81
|
+
fn: function (_sys) {
|
|
82
82
|
const keys = [];
|
|
83
83
|
for (const key in window.localStorage) {
|
|
84
84
|
keys.push(key);
|