@superblocksteam/custom-components 1.10.0 → 1.11.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.txt
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Superblocks Community Software License
|
|
2
|
+
|
|
3
|
+
This Superblocks Community License Agreement (the “Agreement”) sets forth the terms on which DayZero
|
|
4
|
+
Software, Inc. d/b/a Superblocks (“Superblocks”) makes available certain software made available by Superblocks
|
|
5
|
+
under this Agreement (the “Software”). BY INSTALLING, DOWNLOADING, ACCESSING, USING OR
|
|
6
|
+
DISTRIBUTING ANY OF THE SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS
|
|
7
|
+
AGREEMENT.IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE
|
|
8
|
+
SOFTWARE. IF YOU ARE RECEIVING THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU
|
|
9
|
+
REPRESENT AND WARRANT THAT YOU HAVE THE ACTUAL AUTHORITY TO AGREE TO THE
|
|
10
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you,
|
|
11
|
+
an individual, or the entity on whose behalf you are receiving the Software.
|
|
12
|
+
|
|
13
|
+
1. LICENSE GRANT AND CONDITIONS.
|
|
14
|
+
|
|
15
|
+
1.1 License. Subject to the terms and conditions of this Agreement, Superblocks hereby grants to Licensee a
|
|
16
|
+
non-exclusive, royalty-free, worldwide, non-transferable, non-sublicenseable license during the term of this
|
|
17
|
+
Agreement to: (a) use the Software; (b) prepare modifications and derivative works of the Software; (c)
|
|
18
|
+
distribute the Software (including without limitation in source code or object code form); and (d) reproduce
|
|
19
|
+
copies of the Software (the “License”). Licensee is not granted the right to, and Licensee shall not, exercise the
|
|
20
|
+
License for an Excluded Purpose. For purposes of this Agreement, “Excluded Purpose” means making
|
|
21
|
+
available any software-as-a-service, platform-as-a-service, infrastructure-as-a-service or other similar online
|
|
22
|
+
service that competes with Superblocks’ products or services.
|
|
23
|
+
|
|
24
|
+
1.2 Conditions. In consideration of the License, Licensee’s distribution of the Software is subject to the
|
|
25
|
+
following conditions:
|
|
26
|
+
|
|
27
|
+
a. Licensee must cause any Software modified by Licensee to carry prominent notices stating that Licensee
|
|
28
|
+
modified the Software.
|
|
29
|
+
b. On each Software copy, Licensee shall reproduce and not remove or alter all Superblocks or third party
|
|
30
|
+
copyright or other proprietary notices contained in the Software, and Licensee must provide the notice
|
|
31
|
+
below with each copy.
|
|
32
|
+
|
|
33
|
+
“This software is made available by DayZero Software, Inc. d/b/a Superblocks, under the terms of the
|
|
34
|
+
Superblocks Community License Agreement. © 2022 DayZero Software, Inc.”
|
|
35
|
+
|
|
36
|
+
1.3 Licensee Modifications. Licensee may add its own copyright notices to modifications made by Licensee
|
|
37
|
+
and may provide additional or different license terms and conditions for use, reproduction, or distribution of
|
|
38
|
+
Licensee’s modifications. While redistributing the Software or modifications thereof, Licensee may choose to
|
|
39
|
+
offer, for a fee or free of charge, support, warranty, indemnity, or other obligations. Licensee, and not
|
|
40
|
+
Superblocks, will be responsible for any such obligations.
|
|
41
|
+
|
|
42
|
+
1.4 No Sublicensing. The License does not include the right to sublicense the Software, however, each recipient
|
|
43
|
+
to which Licensee provides the Software may exercise the Licenses so long as such recipient agrees to the terms
|
|
44
|
+
and conditions of this Agreement.
|
|
45
|
+
|
|
46
|
+
2. TERM AND TERMINATION. This Agreement will continue unless and until earlier terminated as set forth
|
|
47
|
+
herein. If Licensee breaches any of its conditions or obligations under this Agreement, this Agreement will
|
|
48
|
+
terminate automatically and the License will terminate automatically and permanently.
|
|
49
|
+
|
|
50
|
+
3. INTELLECTUAL PROPERTY. As between the parties, Superblocks will retain all right, title, and interest in
|
|
51
|
+
the Software, and all intellectual property rights therein. Superblocks hereby reserves all rights not expressly
|
|
52
|
+
granted to Licensee in this Agreement. Superblocks hereby reserves all rights in its trademarks and service
|
|
53
|
+
marks, and no licenses therein are granted in this Agreement.
|
|
54
|
+
|
|
55
|
+
4. DISCLAIMER. SUPERBLOCKS HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND
|
|
56
|
+
CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY
|
|
57
|
+
DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
|
|
58
|
+
PURPOSE, WITH RESPECT TO THE SOFTWARE.
|
|
59
|
+
|
|
60
|
+
5. LIMITATION OF LIABILITY. SUPERBLOCKS WILL NOT BE LIABLE FOR ANY DAMAGES OF
|
|
61
|
+
ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL,
|
|
62
|
+
SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY
|
|
63
|
+
THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL APPLY TO
|
|
64
|
+
THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
65
|
+
|
|
66
|
+
6. GENERAL.
|
|
67
|
+
|
|
68
|
+
6.1 Governing Law. This Agreement will be governed by and interpreted in accordance with the laws of the
|
|
69
|
+
state of California, without reference to its conflict of laws principles. If Licensee is located within the United
|
|
70
|
+
States, all disputes arising out of this Agreement are subject to the exclusive jurisdiction of courts located in San
|
|
71
|
+
Mateo County, California. USA. If Licensee is located outside of the United States, any dispute, controversy or
|
|
72
|
+
claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in
|
|
73
|
+
accordance with the JAMS International Arbitration Rules. The tribunal will consist of one neutral arbitrator.
|
|
74
|
+
The place of arbitration will be Palo Alto, California. The language to be used in the arbitral proceedings will be
|
|
75
|
+
English. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction
|
|
76
|
+
thereof.
|
|
77
|
+
|
|
78
|
+
6.2. Assignment. Licensee may not assign its rights under this Agreement to any third party. Superblocks may
|
|
79
|
+
freely assign its rights under this Agreement to any third party.
|
|
80
|
+
|
|
81
|
+
6.3. Other. This Agreement is the entire agreement between the parties regarding the subject matter hereof.
|
|
82
|
+
No amendment or modification of this Agreement will be valid or binding upon the parties unless made in
|
|
83
|
+
writing and signed by the duly authorized representatives of both parties. In the event that any provision,
|
|
84
|
+
including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and
|
|
85
|
+
all licenses and rights granted hereunder will immediately terminate. Waiver by Superblocks of a breach of any
|
|
86
|
+
provision of this Agreement or the failure by Superblocks to exercise any right hereunder will not be construed
|
|
87
|
+
as a waiver of any subsequent breach of that right or as a waiver of any other right.
|
package/dist/exportedTypes.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/hooksPlumbing.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// This files contains the basic plumbing that is needed to implement all hooks that are used by custom components.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useHooksInternalContext = useHooksInternalContext;
|
|
2
5
|
// The place where we store the `CCReactInfo` object
|
|
3
6
|
const ccReactInfoRegister = globalThis.__cc_react_info;
|
|
4
7
|
/**
|
|
5
8
|
* A React hook that is used internally by all superblocks hooks for custom components.
|
|
6
9
|
* @returns The React library namespace object used by custom components and the CCRenderingContext object provided by the UI
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
function useHooksInternalContext() {
|
|
9
12
|
if (ccReactInfoRegister === undefined) {
|
|
10
13
|
throw new Error("Cannot find the context object provided by the Superblocks Application Builder UI");
|
|
11
14
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./exportedTypes"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./useSuperblocksContext"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./useSuperblocksIsLoading"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./useSuperblocksWidgetSize"), exports);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSuperblocksContext = useSuperblocksContext;
|
|
4
|
+
const hooksPlumbing_1 = require("./hooksPlumbing");
|
|
2
5
|
/**
|
|
3
6
|
* A React hook that can be used to get the Superblocks context object that contains methods that enable custom components
|
|
4
7
|
* to interact with the Superblocks Application.
|
|
5
8
|
* @returns The Superblocks context object
|
|
6
9
|
*/
|
|
7
|
-
|
|
8
|
-
const { ccRenderingContext } = useHooksInternalContext();
|
|
10
|
+
function useSuperblocksContext() {
|
|
11
|
+
const { ccRenderingContext } = (0, hooksPlumbing_1.useHooksInternalContext)();
|
|
9
12
|
return ccRenderingContext.superblocksContext;
|
|
10
13
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSuperblocksIsLoading = useSuperblocksIsLoading;
|
|
4
|
+
const hooksPlumbing_1 = require("./hooksPlumbing");
|
|
2
5
|
/**
|
|
3
6
|
* A React hook that returns a boolean that indicates whether the current custom component depends on any data that is
|
|
4
7
|
* currently being loaded. This can be used to show a loading indicator in your custom component.
|
|
5
8
|
*/
|
|
6
|
-
|
|
7
|
-
const { React, ccRenderingContext } = useHooksInternalContext();
|
|
9
|
+
function useSuperblocksIsLoading() {
|
|
10
|
+
const { React, ccRenderingContext } = (0, hooksPlumbing_1.useHooksInternalContext)();
|
|
8
11
|
const [isLoading, setIsLoading] = React.useState(ccRenderingContext.isLoadingRef.current);
|
|
9
12
|
// we need to subscribe to changes immediately, so use `useLayoutEffect` to subscribe right after the render phase is finished
|
|
10
13
|
React.useLayoutEffect(() => {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSuperblocksWidgetSize = useSuperblocksWidgetSize;
|
|
4
|
+
const hooksPlumbing_1 = require("./hooksPlumbing");
|
|
2
5
|
/**
|
|
3
6
|
* A React hook that returns the size of the area that is available for the custom component to render in. Calling this
|
|
4
7
|
* hook will cause your custom component to be re-rendered whenever that size changes.
|
|
5
8
|
*/
|
|
6
|
-
|
|
7
|
-
const { React, ccRenderingContext } = useHooksInternalContext();
|
|
9
|
+
function useSuperblocksWidgetSize() {
|
|
10
|
+
const { React, ccRenderingContext } = (0, hooksPlumbing_1.useHooksInternalContext)();
|
|
8
11
|
const [widgetSize, setWidgetSize] = React.useState(ccRenderingContext.widgetSizeRef.current);
|
|
9
12
|
// we need to subscribe to changes immediately, so use `useLayoutEffect` to subscribe right after the render phase is finished
|
|
10
13
|
React.useLayoutEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblocksteam/custom-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Official Superblocks SDK for developing custom components",
|
|
5
5
|
"homepage": "https://www.superblocks.com/",
|
|
6
6
|
"keywords": [
|
|
@@ -12,19 +12,9 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"/dist"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"preinstall": "node -e \"if (process.versions.node.split('.')[0] < 16) { console.error('Incompatible Node version: Please use Node.js v16 or higher'); process.exit(1);}\"",
|
|
17
|
-
"dev": "tsc --watch",
|
|
18
|
-
"build": "tsc --build",
|
|
19
|
-
"clean": "npm run clean:build && rm -rf node_modules",
|
|
20
|
-
"clean:build": "tsc --build --clean && rm -rf dist tsconfig.tsbuildinfo",
|
|
21
|
-
"lint": "eslint . --ext .ts --config .eslintrc.json",
|
|
22
|
-
"lint:fix": "eslint . --ext .ts --config .eslintrc.json --fix",
|
|
23
|
-
"typecheck": "tsc --noEmit"
|
|
24
|
-
},
|
|
25
15
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
27
|
-
"npm": ">=
|
|
16
|
+
"node": ">=20.0.0",
|
|
17
|
+
"npm": ">=9.0.0"
|
|
28
18
|
},
|
|
29
19
|
"devDependencies": {
|
|
30
20
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
@@ -38,7 +28,18 @@
|
|
|
38
28
|
"typescript": "^5.1.6"
|
|
39
29
|
},
|
|
40
30
|
"dependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
31
|
+
"tslib": "^2.6.1",
|
|
32
|
+
"@superblocksteam/util": "1.11.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"preinstall": "node -e \"if (process.versions.node.split('.')[0] < 20) { console.error('Incompatible Node version: Please use Node.js v16 or higher'); process.exit(1);}\"",
|
|
36
|
+
"dev": "tsc --watch",
|
|
37
|
+
"build": "tsc --build",
|
|
38
|
+
"clean": "npm run clean:build && rm -rf node_modules",
|
|
39
|
+
"clean:build": "tsc --build --clean && rm -rf dist tsconfig.tsbuildinfo",
|
|
40
|
+
"lint": "eslint . --ext .ts --config .eslintrc.json",
|
|
41
|
+
"lint:fix": "eslint . --ext .ts --config .eslintrc.json --fix",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"check": "pnpm run lint && pnpm run typecheck"
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
+
}
|