hikkaku 0.1.8 → 0.1.11
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/blocks/index.d.mts +2 -1
- package/blocks/index.mjs +1 -1
- package/client/index.mjs +6 -6
- package/index.d.mts +1 -1
- package/index.mjs +6 -6
- package/package.json +3 -3
- package/{index-p9BGSitw.d.mts → project-9x128tdR.d.mts} +1 -1
- package/vite/index.mjs +1 -1
- /package/{composer-D8CYTp4v.mjs → composer-JWWbnKkh.mjs} +0 -0
package/blocks/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as PrimitiveSource, h as ListReference, m as HikkakuBlock, p as CostumeSource, x as VariableReference, y as SoundSource } from "../
|
|
1
|
+
import { _ as PrimitiveSource, h as ListReference, m as HikkakuBlock, p as CostumeSource, x as VariableReference, y as SoundSource } from "../project-9x128tdR.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/blocks/control.d.ts
|
|
4
4
|
type StopOption = 'all' | 'this script' | 'other scripts in sprite' | 'other scripts in stage';
|
|
@@ -181,6 +181,7 @@ declare const defineProcedure: <T extends ProcedureProc[]>(proclist: T, stack?:
|
|
|
181
181
|
* If true, the procedure will run without screen refresh until it completes.
|
|
182
182
|
* This can make the procedure run faster, but the screen will not update until the procedure is done.
|
|
183
183
|
*/
|
|
184
|
+
|
|
184
185
|
warp?: boolean) => HikkakuBlock;
|
|
185
186
|
declare const callProcedure: (proccode: string, argumentIds: string[], inputs: Record<string, PrimitiveSource<string | number | boolean>>, warp?: boolean) => HikkakuBlock;
|
|
186
187
|
declare const argumentReporterStringNumber: (reference: ProcedureStringOrNumberReference) => HikkakuBlock;
|
package/blocks/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as fromCostumeSource, i as valueBlock, o as fromPrimitiveSource, r as substack, s as fromSoundSource, t as block } from "../composer-
|
|
1
|
+
import { a as fromCostumeSource, i as valueBlock, o as fromPrimitiveSource, r as substack, s as fromSoundSource, t as block } from "../composer-JWWbnKkh.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/blocks/control.ts
|
|
4
4
|
const repeat = (times, handler) => {
|
package/client/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ const findDOMAppRoot = () => {
|
|
|
4
4
|
for (const el of probably) if (el && "_reactRootContainer" in el) return el;
|
|
5
5
|
throw new Error("Could not find root DOM node. Make sure you are running this in a Scratch environment.");
|
|
6
6
|
};
|
|
7
|
-
function getSpecifiedFiber(root
|
|
8
|
-
const stack = [root
|
|
7
|
+
function getSpecifiedFiber(root, cond) {
|
|
8
|
+
const stack = [root];
|
|
9
9
|
while (true) {
|
|
10
10
|
const fiber = stack.pop();
|
|
11
11
|
if (!fiber) return null;
|
|
@@ -14,16 +14,16 @@ function getSpecifiedFiber(root$1, cond) {
|
|
|
14
14
|
if (fiber.sibling) stack.push(fiber.sibling);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
const getAppFiberNode = (root
|
|
18
|
-
let cur = root
|
|
17
|
+
const getAppFiberNode = (root) => {
|
|
18
|
+
let cur = root.child;
|
|
19
19
|
while (cur) {
|
|
20
20
|
if ("memoizedProps" in cur && "store" in cur.memoizedProps) return cur;
|
|
21
21
|
cur = cur.child;
|
|
22
22
|
}
|
|
23
23
|
throw new Error("Could not find app fiber node.");
|
|
24
24
|
};
|
|
25
|
-
const getScratchInternalStates = (root
|
|
26
|
-
const rootFiberNode = root
|
|
25
|
+
const getScratchInternalStates = (root) => {
|
|
26
|
+
const rootFiberNode = root._reactRootContainer._internalRoot.current;
|
|
27
27
|
const reduxState = getAppFiberNode(rootFiberNode).memoizedProps.store.getState();
|
|
28
28
|
const vm = reduxState.scratchGui.vm;
|
|
29
29
|
const scratchBlocksFiber = getSpecifiedFiber(rootFiberNode, (fiber) => {
|
package/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as PrimitiveSource, a as block, b as VariableBase, c as valueBlock, d as fromSoundSource, f as CostumeReference, g as PrimitiveAvailableOnScratch, h as ListReference, i as Handler, l as fromCostumeSource, m as HikkakuBlock, n as Target, o as createBlocks, p as CostumeSource, r as BlockInit, s as substack, t as Project, u as fromPrimitiveSource, v as SoundReference, x as VariableReference, y as SoundSource } from "./
|
|
1
|
+
import { _ as PrimitiveSource, a as block, b as VariableBase, c as valueBlock, d as fromSoundSource, f as CostumeReference, g as PrimitiveAvailableOnScratch, h as ListReference, i as Handler, l as fromCostumeSource, m as HikkakuBlock, n as Target, o as createBlocks, p as CostumeSource, r as BlockInit, s as substack, t as Project, u as fromPrimitiveSource, v as SoundReference, x as VariableReference, y as SoundSource } from "./project-9x128tdR.mjs";
|
|
2
2
|
export { BlockInit, CostumeReference, CostumeSource, Handler, HikkakuBlock, ListReference, PrimitiveAvailableOnScratch, PrimitiveSource, Project, SoundReference, SoundSource, Target, VariableBase, VariableReference, block, createBlocks, fromCostumeSource, fromPrimitiveSource, fromSoundSource, substack, valueBlock };
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as fromCostumeSource, i as valueBlock, n as createBlocks, o as fromPrimitiveSource, r as substack, s as fromSoundSource, t as block } from "./composer-
|
|
1
|
+
import { a as fromCostumeSource, i as valueBlock, n as createBlocks, o as fromPrimitiveSource, r as substack, s as fromSoundSource, t as block } from "./composer-JWWbnKkh.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/project.ts
|
|
4
4
|
let nextAssetId = 0;
|
|
@@ -15,14 +15,14 @@ const coreOpcodePrefixes = new Set([
|
|
|
15
15
|
"sensing",
|
|
16
16
|
"sound"
|
|
17
17
|
]);
|
|
18
|
-
const isBlockObject = (block
|
|
19
|
-
return typeof block
|
|
18
|
+
const isBlockObject = (block) => {
|
|
19
|
+
return typeof block === "object" && block !== null && "opcode" in block;
|
|
20
20
|
};
|
|
21
21
|
const collectExtensions = (targets) => {
|
|
22
22
|
const extensions = /* @__PURE__ */ new Set();
|
|
23
|
-
for (const target of targets) for (const block
|
|
24
|
-
if (!isBlockObject(block
|
|
25
|
-
const [prefix] = block
|
|
23
|
+
for (const target of targets) for (const block of Object.values(target.blocks)) {
|
|
24
|
+
if (!isBlockObject(block)) continue;
|
|
25
|
+
const [prefix] = block.opcode.split("_");
|
|
26
26
|
if (prefix && !coreOpcodePrefixes.has(prefix)) extensions.add(prefix);
|
|
27
27
|
}
|
|
28
28
|
return Array.from(extensions).sort();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hikkaku",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"exports": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"typescript": "^5"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"sb3-types": "0.1.10",
|
|
37
|
+
"vite": "8.0.0-beta.8"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"url": "https://github.com/pnsk-lab/hikkaku",
|
package/vite/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ function hikkaku(init) {
|
|
|
38
38
|
});
|
|
39
39
|
server.middlewares.use(async (req, res, next) => {
|
|
40
40
|
if (req.url === "/") {
|
|
41
|
-
const html = (await fetch(BASE_URL).then((res
|
|
41
|
+
const html = (await fetch(BASE_URL).then((res) => res.text())).replace("gui.js", "https://scratchfoundation.github.io/scratch-gui/gui.js").replace("</head>", "<script src=\"/@vite/client\" type=\"module\"><\/script><script type=\"module\" src=\"/@virtual/hikkaku-client\"><\/script></head>");
|
|
42
42
|
res.setHeader("Content-Type", "text/html");
|
|
43
43
|
res.end(html);
|
|
44
44
|
return;
|
|
File without changes
|