@rbxts/scribe-fusion 2.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/LICENSE +21 -0
- package/NOTICE +21 -0
- package/README.md +5 -0
- package/Scribe-source-map.json +1 -0
- package/index.d.ts +41 -0
- package/init.luau +25 -0
- package/package.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ericplane
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Scribe
|
|
2
|
+
Copyright (c) 2026 ericplane
|
|
3
|
+
Licensed under the MIT License (see LICENSE).
|
|
4
|
+
|
|
5
|
+
This product bundles a modified copy of ProfileStore v1.0.3:
|
|
6
|
+
|
|
7
|
+
ProfileStore
|
|
8
|
+
Copyright (c) loleris / MAD STUDIO
|
|
9
|
+
https://github.com/MadStudioRoblox/ProfileStore
|
|
10
|
+
Licensed under the Apache License, Version 2.0.
|
|
11
|
+
|
|
12
|
+
The bundled copy lives at src/Internal/Store/ProfileStore.luau and HAS BEEN
|
|
13
|
+
MODIFIED. Every modification is marked `SCRIBE PATCH` in that file and summarised
|
|
14
|
+
in its header. A copy of the Apache License, Version 2.0 is included at
|
|
15
|
+
licenses/ProfileStore-Apache-2.0.txt.
|
|
16
|
+
|
|
17
|
+
The licence text is kept OUTSIDE src/ on purpose. Everything under src/ is packed
|
|
18
|
+
into the released .rbxm, where a plain text file has no place and whose contents
|
|
19
|
+
Roblox scans for off-platform links -- and the licence is full of them. Attribution
|
|
20
|
+
travels with the code in the file header, which is what Apache-2.0 section 4
|
|
21
|
+
actually asks for; the full text travels with the source package.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"2.5.0","format":1,"description":"Segments are [packedLine, sourceLine]. Use the last segment at or before the packed line, then add its line offset.","files":{"addons/ui/ScribeFusion.luau":{"sourceSha256":"c7816956ceab0c26674b2282c8a56e47f46647948683a6a97c3ec738c246aae6","packedSha256":"7608f7e0848bbf6579e065b06f8f59a97a494183296bd22f92ff30bd7d447aac","segments":[[1,1]],"packagePath":"init.luau"}}}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type Scribe from "@rbxts/scribe";
|
|
2
|
+
|
|
3
|
+
/** Fusion 0.2: call the returned disconnect when the UI is destroyed. */
|
|
4
|
+
declare function ScribeFusion(fusion: ScribeFusion.LegacyFramework): ScribeFusion.Adapter;
|
|
5
|
+
/** Fusion 0.3: the disconnect is also registered in the supplied cleanup scope. */
|
|
6
|
+
declare function ScribeFusion<Scope extends unknown[], Framework extends ScribeFusion.ScopedFramework<Scope>>(
|
|
7
|
+
fusion: Framework,
|
|
8
|
+
scope: Scope,
|
|
9
|
+
): ScribeFusion.ScopedAdapter<ReturnType<Framework["Value"]>>;
|
|
10
|
+
|
|
11
|
+
declare namespace ScribeFusion {
|
|
12
|
+
type Adapter = <T>(this: void, accessor: Scribe.ReadableNode<T>) => LuaTuple<[LegacyValue<T>, () => void]>;
|
|
13
|
+
type ScopedAdapter<Value extends ScopedValue<unknown> = ScopedValue<unknown>> = <T>(
|
|
14
|
+
this: void,
|
|
15
|
+
accessor: Scribe.ReadableNode<T>,
|
|
16
|
+
) => LuaTuple<[Omit<Value, "set" | "_EXTREMELY_DANGEROUS_usedAsValue"> & ScopedValue<T>, () => void]>;
|
|
17
|
+
/** Structurally compatible with @rbxts/fusion 0.2's Value<T>. */
|
|
18
|
+
interface LegacyValue<T> {
|
|
19
|
+
readonly type: "State";
|
|
20
|
+
readonly kind: "Value";
|
|
21
|
+
get(asDependency?: boolean): T;
|
|
22
|
+
set(value: T, force?: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
interface LegacyFramework {
|
|
25
|
+
readonly Value: <T>(this: void, initialValue: T) => LegacyValue<T>;
|
|
26
|
+
}
|
|
27
|
+
/** Public surface of a Fusion 0.3 Value. Read it through your framework's peek/use. */
|
|
28
|
+
interface ScopedValue<T> {
|
|
29
|
+
readonly type: "State";
|
|
30
|
+
readonly kind: "Value";
|
|
31
|
+
/** @internal Present for compatibility with Fusion's StateObject<T> inference. Do not read directly. */
|
|
32
|
+
readonly _EXTREMELY_DANGEROUS_usedAsValue: T;
|
|
33
|
+
set(value: T): void;
|
|
34
|
+
}
|
|
35
|
+
/** The 0.3 package is supplied by the caller; no separate framework is bundled. */
|
|
36
|
+
interface ScopedFramework<Scope> {
|
|
37
|
+
readonly Value: <T>(this: void, scope: Scope, initialValue: T) => ScopedValue<T>;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export = ScribeFusion;
|
package/init.luau
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
--!strict
|
|
2
|
+
-- Fusion adapter. Copy into your game; not part of the Scribe package.
|
|
3
|
+
-- local useScribe = require(path.to.ScribeFusion)(Fusion, scope) -- 0.3
|
|
4
|
+
-- local useScribe = require(path.to.ScribeFusion)(Fusion) -- 0.2
|
|
5
|
+
-- local coins, disconnect = useScribe(Data.Coins)
|
|
6
|
+
-- With a scope the disconnect is also registered in it, so doCleanup(scope) runs it.
|
|
7
|
+
|
|
8
|
+
export type Disconnect = () -> ()
|
|
9
|
+
|
|
10
|
+
--- `scope` selects the calling convention: pass it on 0.3, omit it on 0.2.
|
|
11
|
+
return function(Fusion: any, scope: any?)
|
|
12
|
+
--- A Value tracking one accessor. The disconnect is returned either way; with a
|
|
13
|
+
--- scope it is registered there too, and a second call is a no-op.
|
|
14
|
+
return function(accessor: any): (any, Disconnect)
|
|
15
|
+
local value = if scope ~= nil then Fusion.Value(scope, accessor.Get()) else Fusion.Value(accessor.Get())
|
|
16
|
+
-- Observe, not Changed: it delivers the current value before returning.
|
|
17
|
+
local disconnect = accessor.Observe(function(new)
|
|
18
|
+
value:set(new)
|
|
19
|
+
end)
|
|
20
|
+
if scope ~= nil then
|
|
21
|
+
table.insert(scope, disconnect)
|
|
22
|
+
end
|
|
23
|
+
return value, disconnect
|
|
24
|
+
end
|
|
25
|
+
end
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rbxts/scribe-fusion",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "Optional fusion addon for Scribe",
|
|
5
|
+
"main": "init.luau",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/ericplane/Scribe.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://scribe.ericplane.dev/",
|
|
13
|
+
"author": "ericplane",
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@rbxts/scribe": "^2.5.0",
|
|
16
|
+
"@rbxts/fusion": "^0.2.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependenciesMeta": {
|
|
19
|
+
"@rbxts/fusion": {
|
|
20
|
+
"optional": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|