@livepreso/content-react 0.0.2
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/.eslintrc.js +8 -0
- package/.rush/temp/package-deps_build.json +26 -0
- package/.rush/temp/package-deps_test.json +26 -0
- package/.rush/temp/shrinkwrap-deps.json +140 -0
- package/.stylelintrc +9 -0
- package/CHANGELOG.json +28 -0
- package/CHANGELOG.md +16 -0
- package/content-react.build.log +2 -0
- package/index.js +74 -0
- package/lib/components/ScrollableArea.js +26 -0
- package/lib/components/ScrollableArea.module.scss +7 -0
- package/lib/components/Subslide.js +111 -0
- package/lib/components/Subslides.js +71 -0
- package/lib/components/index.js +3 -0
- package/lib/contexts.js +20 -0
- package/lib/hooks/index.js +6 -0
- package/lib/hooks/use-async-reference.js +20 -0
- package/lib/hooks/use-context.js +62 -0
- package/lib/hooks/use-modes.js +20 -0
- package/lib/hooks/use-root-slide.js +133 -0
- package/lib/hooks/use-shared-state.js +82 -0
- package/lib/hooks/use-subslides.js +30 -0
- package/lib/hooks/use-transitions.js +14 -0
- package/package.json +28 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": {
|
|
3
|
+
"content/content-react/.eslintrc.js": "6245fc28bbe1102d1b4c2a1db96a508e6221f6bd",
|
|
4
|
+
"content/content-react/.stylelintrc": "5c129c044fdf8b0dfd92da7860ea25f60bcde085",
|
|
5
|
+
"content/content-react/CHANGELOG.json": "001e63a228a710a99d8534c5bc38ddf662946eed",
|
|
6
|
+
"content/content-react/CHANGELOG.md": "b5932d45a8c6fcebf4267435c93a9d98a153242e",
|
|
7
|
+
"content/content-react/index.js": "826cec91ed8d4b018b33a847b4df6a3e8631d220",
|
|
8
|
+
"content/content-react/lib/components/ScrollableArea.js": "ee97a6ce605c2071f879382d1f347fe4fed83ee4",
|
|
9
|
+
"content/content-react/lib/components/ScrollableArea.module.scss": "74543f283eb2db0b67d70ffe0d068e03a1131573",
|
|
10
|
+
"content/content-react/lib/components/Subslide.js": "ddec8751b9a86d0cc5f587ec31d7d426f42648c5",
|
|
11
|
+
"content/content-react/lib/components/Subslides.js": "764d5901525bab61b8f72dc4fe399a356b185e12",
|
|
12
|
+
"content/content-react/lib/components/index.js": "f233f0e270fc648dc9c8ae2abfa93bd9e8ccdc01",
|
|
13
|
+
"content/content-react/lib/contexts.js": "59a0173397a32c788c0d61ee317741fe0a9c9bee",
|
|
14
|
+
"content/content-react/lib/hooks/index.js": "6fcf567354b94f0ab3fb0e2c4bf502cd5a81429e",
|
|
15
|
+
"content/content-react/lib/hooks/use-async-reference.js": "23e3eeff2b87b530d40129a049996a5fe76e34c6",
|
|
16
|
+
"content/content-react/lib/hooks/use-context.js": "3f697379e6ee9790ba6b4ae96ad6d6c2ba20a669",
|
|
17
|
+
"content/content-react/lib/hooks/use-modes.js": "ad8e27b3659b0fcf6fbe79333ccec86d690ed983",
|
|
18
|
+
"content/content-react/lib/hooks/use-root-slide.js": "98ce55032605df9507467b32f7969355318330f4",
|
|
19
|
+
"content/content-react/lib/hooks/use-shared-state.js": "0d160ddf3e5dec37849f72f4ec2a1d7aac680159",
|
|
20
|
+
"content/content-react/lib/hooks/use-subslides.js": "508ac21b01a4ece811ebc2db9c6a41ef6071e326",
|
|
21
|
+
"content/content-react/lib/hooks/use-transitions.js": "c9cdf3e8af82b8f8a51e99ee670334cc5c7c42c1",
|
|
22
|
+
"content/content-react/package.json": "1bed2af8c66bfa4ad2540e0e001cea26109435eb",
|
|
23
|
+
"content/content-react/.rush/temp/shrinkwrap-deps.json": "b1ad1f22903e0092d2fa7647b96a86692d3accaf"
|
|
24
|
+
},
|
|
25
|
+
"arguments": ""
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": {
|
|
3
|
+
"content/content-react/.rush/temp/shrinkwrap-deps.json": "4645c4e5204fbf6e4b13573ceeacb3c093ff7a90",
|
|
4
|
+
"content/content-react/.eslintrc.js": "6245fc28bbe1102d1b4c2a1db96a508e6221f6bd",
|
|
5
|
+
"content/content-react/.stylelintrc": "5c129c044fdf8b0dfd92da7860ea25f60bcde085",
|
|
6
|
+
"content/content-react/CHANGELOG.json": "001e63a228a710a99d8534c5bc38ddf662946eed",
|
|
7
|
+
"content/content-react/CHANGELOG.md": "b5932d45a8c6fcebf4267435c93a9d98a153242e",
|
|
8
|
+
"content/content-react/index.js": "826cec91ed8d4b018b33a847b4df6a3e8631d220",
|
|
9
|
+
"content/content-react/lib/components/ScrollableArea.js": "ee97a6ce605c2071f879382d1f347fe4fed83ee4",
|
|
10
|
+
"content/content-react/lib/components/ScrollableArea.module.scss": "74543f283eb2db0b67d70ffe0d068e03a1131573",
|
|
11
|
+
"content/content-react/lib/components/Subslide.js": "ddec8751b9a86d0cc5f587ec31d7d426f42648c5",
|
|
12
|
+
"content/content-react/lib/components/Subslides.js": "764d5901525bab61b8f72dc4fe399a356b185e12",
|
|
13
|
+
"content/content-react/lib/components/index.js": "f233f0e270fc648dc9c8ae2abfa93bd9e8ccdc01",
|
|
14
|
+
"content/content-react/lib/contexts.js": "59a0173397a32c788c0d61ee317741fe0a9c9bee",
|
|
15
|
+
"content/content-react/lib/hooks/index.js": "6fcf567354b94f0ab3fb0e2c4bf502cd5a81429e",
|
|
16
|
+
"content/content-react/lib/hooks/use-async-reference.js": "23e3eeff2b87b530d40129a049996a5fe76e34c6",
|
|
17
|
+
"content/content-react/lib/hooks/use-context.js": "3f697379e6ee9790ba6b4ae96ad6d6c2ba20a669",
|
|
18
|
+
"content/content-react/lib/hooks/use-modes.js": "ad8e27b3659b0fcf6fbe79333ccec86d690ed983",
|
|
19
|
+
"content/content-react/lib/hooks/use-root-slide.js": "98ce55032605df9507467b32f7969355318330f4",
|
|
20
|
+
"content/content-react/lib/hooks/use-shared-state.js": "0d160ddf3e5dec37849f72f4ec2a1d7aac680159",
|
|
21
|
+
"content/content-react/lib/hooks/use-subslides.js": "508ac21b01a4ece811ebc2db9c6a41ef6071e326",
|
|
22
|
+
"content/content-react/lib/hooks/use-transitions.js": "c9cdf3e8af82b8f8a51e99ee670334cc5c7c42c1",
|
|
23
|
+
"content/content-react/package.json": "1bed2af8c66bfa4ad2540e0e001cea26109435eb"
|
|
24
|
+
},
|
|
25
|
+
"arguments": ""
|
|
26
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"../../content/content-react": "../../content/content-react:cklG8HGZMCD4xcvDWwkIseCBlSaZo+2oxATz93QU/k4=:",
|
|
3
|
+
"/@babel/helper-annotate-as-pure/7.16.7": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==",
|
|
4
|
+
"/@babel/helper-module-imports/7.16.7": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
|
|
5
|
+
"/@babel/helper-plugin-utils/7.16.7": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
|
|
6
|
+
"/@babel/helper-validator-identifier/7.16.7": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
|
|
7
|
+
"/@babel/helper-validator-option/7.16.7": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
|
|
8
|
+
"/@babel/plugin-syntax-jsx/7.16.7": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==",
|
|
9
|
+
"/@babel/plugin-transform-react-display-name/7.16.7": "sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg==",
|
|
10
|
+
"/@babel/plugin-transform-react-jsx-development/7.16.7": "sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A==",
|
|
11
|
+
"/@babel/plugin-transform-react-jsx/7.17.3": "sha512-9tjBm4O07f7mzKSIlEmPdiE6ub7kfIe6Cd+w+oQebpATfTQMAgW+YOuWxogbKVTulA+MEO7byMeIUtQ1z+z+ZQ==",
|
|
12
|
+
"/@babel/plugin-transform-react-pure-annotations/7.16.7": "sha512-hs71ToC97k3QWxswh2ElzMFABXHvGiJ01IB1TbYQDGeWRKWz/MPUTh5jGExdHvosYKpnJW5Pm3S4+TA3FyX+GA==",
|
|
13
|
+
"/@babel/preset-react/7.14.5": "sha512-XFxBkjyObLvBaAvkx1Ie95Iaq4S/GUEIrejyrntQ/VCMKUYvKLoyKxOBzJ2kjA3b6rC9/KL6KXfDC2GqvLiNqQ==",
|
|
14
|
+
"/@babel/types/7.17.0": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==",
|
|
15
|
+
"/@microsoft/tsdoc-config/0.15.2": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==",
|
|
16
|
+
"/@microsoft/tsdoc/0.13.2": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==",
|
|
17
|
+
"/@nodelib/fs.scandir/2.1.5": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
|
|
18
|
+
"/@nodelib/fs.stat/2.0.5": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
|
|
19
|
+
"/@nodelib/fs.walk/1.2.8": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
|
|
20
|
+
"/@rushstack/eslint-config/2.4.5": "sha512-MilTlXhJMvJhsud/Sb+otph/JTLuoUQYO/MK6SCiGsoCWlIOgbw+JKUjs4viu6Kocd0VqfbNCXFqWRqCbdq4DA==",
|
|
21
|
+
"/@rushstack/eslint-patch/1.1.0": "sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A==",
|
|
22
|
+
"/@rushstack/eslint-plugin-packlets/0.3.3": "sha512-6fslCsfk1mZho4uBsnywCO5Jzj7I21V1OKt40ZxbLO7LrMccm9orUYJiy5dI3Lx6NQtczuYrtqp8Xqp0ur9KPA==",
|
|
23
|
+
"/@rushstack/eslint-plugin-security/0.2.3": "sha512-OnngkJCx91og1U8a8gus2g+r5OOtkQ8Tpo8jcGrtI6YpIIujqLM6lIe7XM3e+iumYdKnnOAVs3NH14BN9rlIoQ==",
|
|
24
|
+
"/@rushstack/eslint-plugin/0.8.3": "sha512-LUXUv9oUDHghe73HHIqDxJAqCYBsvKcbg+2KRs/aNczNZzoaXKJPLS6YvlCBiuI1XNq/eLEX7L/LPnKfbe+1Yw==",
|
|
25
|
+
"/@rushstack/tree-pattern/0.2.2": "sha512-0KdqI7hGtVIlxobOBLWet0WGiD70V/QoYQr5A2ikACeQmIaN4WT6Fn9BcvgwgaSIMcazEcD8ql7Fb9N4dKdQlA==",
|
|
26
|
+
"/@types/json-schema/7.0.9": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==",
|
|
27
|
+
"/@typescript-eslint/eslint-plugin/4.31.2_@typescript-eslint+parser@4.31.2": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==",
|
|
28
|
+
"/@typescript-eslint/experimental-utils/4.31.2": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==",
|
|
29
|
+
"/@typescript-eslint/parser/4.31.2": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==",
|
|
30
|
+
"/@typescript-eslint/scope-manager/4.31.2": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==",
|
|
31
|
+
"/@typescript-eslint/types/4.31.2": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==",
|
|
32
|
+
"/@typescript-eslint/typescript-estree/4.31.2": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==",
|
|
33
|
+
"/@typescript-eslint/visitor-keys/4.31.2": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==",
|
|
34
|
+
"/ajv/6.12.6": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
|
35
|
+
"/anylogger/1.0.11": "sha512-sKTWPTG2/d71kLGVmymMJQQslUppxvCz6DN/eODL3/ckmfygZzD0t4P5tRXE3qpM62jI98F/YTHHzFhM12jiJQ==",
|
|
36
|
+
"/array-includes/3.1.4": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==",
|
|
37
|
+
"/array-union/2.1.0": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
|
38
|
+
"/array.prototype.flatmap/1.2.5": "sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA==",
|
|
39
|
+
"/braces/3.0.2": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
40
|
+
"/call-bind/1.0.2": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
|
41
|
+
"/debug/4.3.3": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
|
|
42
|
+
"/define-properties/1.1.3": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
|
|
43
|
+
"/dir-glob/3.0.1": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
|
|
44
|
+
"/doctrine/2.1.0": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
|
45
|
+
"/es-abstract/1.19.1": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==",
|
|
46
|
+
"/es-to-primitive/1.2.1": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
|
|
47
|
+
"/eslint-plugin-promise/4.2.1": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==",
|
|
48
|
+
"/eslint-plugin-react/7.20.6": "sha512-kidMTE5HAEBSLu23CUDvj8dc3LdBU0ri1scwHBZjI41oDv4tjsWZKU7MQccFzH1QYPYhsnTF2ovh7JlcIcmxgg==",
|
|
49
|
+
"/eslint-plugin-tsdoc/0.2.14": "sha512-fJ3fnZRsdIoBZgzkQjv8vAj6NeeOoFkTfgosj6mKsFjX70QV256sA/wq+y/R2+OL4L8E79VVaVWrPeZnKNe8Ng==",
|
|
50
|
+
"/eslint-scope/5.1.1": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
|
51
|
+
"/eslint-utils/3.0.0": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
|
|
52
|
+
"/eslint-visitor-keys/2.1.0": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
|
|
53
|
+
"/esrecurse/4.3.0": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
|
|
54
|
+
"/estraverse/4.3.0": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
|
55
|
+
"/estraverse/5.3.0": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
|
56
|
+
"/esutils/2.0.3": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
|
57
|
+
"/fast-deep-equal/3.1.3": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
|
58
|
+
"/fast-glob/3.2.11": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==",
|
|
59
|
+
"/fast-json-stable-stringify/2.1.0": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
|
|
60
|
+
"/fastq/1.13.0": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
|
|
61
|
+
"/fill-range/7.0.1": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
62
|
+
"/function-bind/1.1.1": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
|
63
|
+
"/functional-red-black-tree/1.0.1": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
|
|
64
|
+
"/get-intrinsic/1.1.1": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
|
|
65
|
+
"/get-symbol-description/1.0.0": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
|
|
66
|
+
"/glob-parent/5.1.2": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
|
67
|
+
"/globby/11.1.0": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
|
|
68
|
+
"/has-bigints/1.0.1": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
|
|
69
|
+
"/has-symbols/1.0.3": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
|
70
|
+
"/has-tostringtag/1.0.0": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
|
|
71
|
+
"/has/1.0.3": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
|
72
|
+
"/ignore/5.2.0": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==",
|
|
73
|
+
"/internal-slot/1.0.3": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
|
|
74
|
+
"/is-bigint/1.0.4": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
|
|
75
|
+
"/is-boolean-object/1.1.2": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
|
|
76
|
+
"/is-callable/1.2.4": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
|
|
77
|
+
"/is-core-module/2.8.1": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
|
|
78
|
+
"/is-date-object/1.0.5": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
|
|
79
|
+
"/is-extglob/2.1.1": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
|
|
80
|
+
"/is-glob/4.0.3": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
|
81
|
+
"/is-negative-zero/2.0.2": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==",
|
|
82
|
+
"/is-number-object/1.0.6": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
|
|
83
|
+
"/is-number/7.0.0": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
84
|
+
"/is-regex/1.1.4": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
|
|
85
|
+
"/is-shared-array-buffer/1.0.1": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==",
|
|
86
|
+
"/is-string/1.0.7": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
|
|
87
|
+
"/is-symbol/1.0.4": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
|
|
88
|
+
"/is-weakref/1.0.2": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
|
|
89
|
+
"/jju/1.4.0": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=",
|
|
90
|
+
"/js-tokens/4.0.0": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
|
|
91
|
+
"/json-schema-traverse/0.4.1": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
|
92
|
+
"/jsx-ast-utils/2.4.1": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==",
|
|
93
|
+
"/kurly/2.0.0-beta.3": "sha512-WXSRkhL2VV9lI/sPomBDV9Xf4oQ1s/RiUqzxKt4slkG7ndCxcDfXJ2ZXdxEYDRfevnkSOxmiVX3etunBlHqTAw==",
|
|
94
|
+
"/lodash.get/4.4.2": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
|
|
95
|
+
"/lodash.isplainobject/4.0.6": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
|
|
96
|
+
"/loose-envify/1.4.0": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
|
|
97
|
+
"/lru-cache/6.0.0": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
|
98
|
+
"/merge2/1.4.1": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
|
99
|
+
"/micromatch/4.0.4": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
|
|
100
|
+
"/ms/2.1.2": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
|
101
|
+
"/object-assign/4.1.1": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
|
102
|
+
"/object-inspect/1.12.0": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==",
|
|
103
|
+
"/object-keys/1.1.1": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
|
|
104
|
+
"/object.assign/4.1.2": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
|
|
105
|
+
"/object.entries/1.1.5": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==",
|
|
106
|
+
"/object.fromentries/2.0.5": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==",
|
|
107
|
+
"/object.values/1.1.5": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==",
|
|
108
|
+
"/path-parse/1.0.7": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
|
109
|
+
"/path-type/4.0.0": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
|
110
|
+
"/picomatch/2.3.1": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
|
111
|
+
"/prop-types/15.8.1": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
|
112
|
+
"/punycode/2.1.1": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
|
|
113
|
+
"/queue-microtask/1.2.3": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
|
|
114
|
+
"/react-dom/17.0.2_react@17.0.2": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==",
|
|
115
|
+
"/react-is/16.13.1": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
|
116
|
+
"/react/17.0.2": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
|
|
117
|
+
"/regexp.prototype.flags/1.4.1": "sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ==",
|
|
118
|
+
"/regexpp/3.2.0": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
|
|
119
|
+
"/resolve/1.19.0": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
|
|
120
|
+
"/resolve/1.22.0": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
|
|
121
|
+
"/reusify/1.0.4": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
|
|
122
|
+
"/run-parallel/1.2.0": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
|
|
123
|
+
"/scheduler/0.20.2": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==",
|
|
124
|
+
"/semver/7.3.5": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
|
125
|
+
"/side-channel/1.0.4": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
|
126
|
+
"/slash/3.0.0": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
|
127
|
+
"/string.prototype.matchall/4.0.6": "sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg==",
|
|
128
|
+
"/string.prototype.trimend/1.0.4": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
|
|
129
|
+
"/string.prototype.trimstart/1.0.4": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
|
|
130
|
+
"/supports-preserve-symlinks-flag/1.0.0": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
|
131
|
+
"/to-fast-properties/2.0.0": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
|
|
132
|
+
"/to-regex-range/5.0.1": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
133
|
+
"/tslib/1.14.1": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
|
134
|
+
"/tsutils/3.21.0": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
|
|
135
|
+
"/ulog/2.0.0-beta.19": "sha512-27YIp4dUwaJQTh7ovk60wWjBMVV/AXMZhSVftkU7HMjaPc1t8wO5u6hVVUyBTyGKrLxYmR0v34Iihq8mE26LUg==",
|
|
136
|
+
"/unbox-primitive/1.0.1": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
|
|
137
|
+
"/uri-js/4.4.1": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
|
|
138
|
+
"/which-boxed-primitive/1.0.2": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
|
|
139
|
+
"/yallist/4.0.0": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
|
140
|
+
}
|
package/.stylelintrc
ADDED
package/CHANGELOG.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@livepreso/content-react",
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.0.2",
|
|
6
|
+
"tag": "@livepreso/content-react_v0.0.2",
|
|
7
|
+
"date": "Wed, 01 Jun 2022 00:55:51 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "General fixes"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"dependency": [
|
|
15
|
+
{
|
|
16
|
+
"comment": "Updating dependency \"@livepreso/content-base\" from `~0.0.1` to `~0.0.2`"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.0.1",
|
|
23
|
+
"tag": "@livepreso/content-react_v0.0.1",
|
|
24
|
+
"date": "Thu, 05 Aug 2021 06:38:32 GMT",
|
|
25
|
+
"comments": {}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Change Log - @livepreso/content-react
|
|
2
|
+
|
|
3
|
+
This log was last generated on Wed, 01 Jun 2022 00:56:50 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.0.2
|
|
6
|
+
Wed, 01 Jun 2022 00:55:51 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- General fixes
|
|
11
|
+
|
|
12
|
+
## 0.0.1
|
|
13
|
+
Thu, 05 Aug 2021 06:38:32 GMT
|
|
14
|
+
|
|
15
|
+
_Initial release_
|
|
16
|
+
|
package/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import { AppBase } from "@livepreso/content-base";
|
|
4
|
+
import ReactDOM from "react-dom";
|
|
5
|
+
import { SlideContext } from "./lib/contexts.js";
|
|
6
|
+
import errorFn from "@livepreso/content-base/error.js";
|
|
7
|
+
import { useRootSlide } from "./lib/hooks/use-root-slide.js";
|
|
8
|
+
|
|
9
|
+
class ErrorBoundary extends React.Component {
|
|
10
|
+
static getDerivedStateFromError(error) {
|
|
11
|
+
return { error, hasError: true };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
state = {
|
|
15
|
+
error: null,
|
|
16
|
+
hasError: false,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
if (this.state.hasError) {
|
|
21
|
+
errorFn(this.state.error)(this.props.el);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return this.props.children;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class App extends AppBase {
|
|
29
|
+
static run(rootApp = null) {
|
|
30
|
+
const base = new App();
|
|
31
|
+
if (rootApp) {
|
|
32
|
+
base.rootApp = rootApp;
|
|
33
|
+
}
|
|
34
|
+
return base;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rootApp(Slide) {
|
|
38
|
+
return <Slide />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
defaultRenderer(Slide, article) {
|
|
42
|
+
const el = article.get(0);
|
|
43
|
+
|
|
44
|
+
const RootApp = this.rootApp(Slide);
|
|
45
|
+
|
|
46
|
+
function App() {
|
|
47
|
+
// TODO: Refactor this to be a prop
|
|
48
|
+
const slideState = useRootSlide(article);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
function slideClosed() {
|
|
52
|
+
ReactDOM.unmountComponentAtNode(el);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
article.on("slide:closed", slideClosed);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<SlideContext.Provider value={slideState}>
|
|
60
|
+
{!slideState.transitions.exited && (
|
|
61
|
+
<ErrorBoundary el={el}>{RootApp}</ErrorBoundary>
|
|
62
|
+
)}
|
|
63
|
+
</SlideContext.Provider>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
ReactDOM.unmountComponentAtNode(el);
|
|
68
|
+
ReactDOM.render(<App />, el);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export * from "./lib/hooks";
|
|
73
|
+
export * from "./lib/contexts.js";
|
|
74
|
+
export * from "./lib/components";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useModes, useSubslides } from "../hooks";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import styles from "./ScrollableArea.module.scss";
|
|
5
|
+
|
|
6
|
+
export function ScrollableArea({ children }) {
|
|
7
|
+
const { isScreenshot } = useModes();
|
|
8
|
+
const { currentSubslideIndex } = useSubslides();
|
|
9
|
+
|
|
10
|
+
const style = {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
top: -(1080 * (currentSubslideIndex - 1)),
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100%"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
if (isScreenshot) {
|
|
18
|
+
return <div style={style} className={styles["scrollable-area"]}>{children}</div>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div style={style} className={styles["scrollable-area"]}>
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-constructed-context-values */
|
|
2
|
+
// TODO: Remove above
|
|
3
|
+
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { SlideContext, SubslideContext } from "../contexts.js";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_TRANSITION_STATE = {
|
|
7
|
+
entering: false,
|
|
8
|
+
entered: false,
|
|
9
|
+
exiting: false,
|
|
10
|
+
exited: false,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function Subslide(props) {
|
|
14
|
+
const {
|
|
15
|
+
id,
|
|
16
|
+
setSubslide,
|
|
17
|
+
endAnimation,
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
index,
|
|
21
|
+
active,
|
|
22
|
+
children,
|
|
23
|
+
animateSpeed,
|
|
24
|
+
} = props;
|
|
25
|
+
const { isSlideReady } = useContext(SlideContext);
|
|
26
|
+
const [transitions, setTransitions] = useState({
|
|
27
|
+
...DEFAULT_TRANSITION_STATE,
|
|
28
|
+
entered: active,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Poor mans classnames. Let's keep dependencies small.
|
|
32
|
+
const classes = ["subslide"];
|
|
33
|
+
|
|
34
|
+
if (typeof className === "string") {
|
|
35
|
+
classes.push(className);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (active) {
|
|
39
|
+
classes.push("currentpage");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const subslide = useRef(null);
|
|
43
|
+
|
|
44
|
+
function animateIn() {
|
|
45
|
+
setSubslide(index);
|
|
46
|
+
setTransitions({
|
|
47
|
+
...DEFAULT_TRANSITION_STATE,
|
|
48
|
+
entering: true,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
subslide.current.ready = true;
|
|
53
|
+
subslide.current.animating(false);
|
|
54
|
+
setTransitions({
|
|
55
|
+
...DEFAULT_TRANSITION_STATE,
|
|
56
|
+
entered: true,
|
|
57
|
+
});
|
|
58
|
+
endAnimation();
|
|
59
|
+
}, animateSpeed);
|
|
60
|
+
return subslide.current;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function animateOut() {
|
|
64
|
+
setTransitions({
|
|
65
|
+
...DEFAULT_TRANSITION_STATE,
|
|
66
|
+
exiting: true,
|
|
67
|
+
});
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
subslide.current.ready = true;
|
|
70
|
+
subslide.current.animating(false);
|
|
71
|
+
setTransitions({
|
|
72
|
+
...DEFAULT_TRANSITION_STATE,
|
|
73
|
+
exited: true,
|
|
74
|
+
});
|
|
75
|
+
endAnimation();
|
|
76
|
+
}, animateSpeed);
|
|
77
|
+
return subslide.current;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (isSlideReady) {
|
|
82
|
+
const bridgeSub = Bridge.Sub.get(`subslide-${index}`);
|
|
83
|
+
|
|
84
|
+
subslide.current = bridgeSub;
|
|
85
|
+
|
|
86
|
+
let transitions = {
|
|
87
|
+
in: animateIn.bind(this),
|
|
88
|
+
out: animateOut.bind(this),
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// The hack
|
|
92
|
+
subslide.current.transitions(transitions);
|
|
93
|
+
|
|
94
|
+
subslide.current.ready = true;
|
|
95
|
+
subslide.current.animating(false);
|
|
96
|
+
}
|
|
97
|
+
}, [isSlideReady]);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<SubslideContext.Provider
|
|
101
|
+
value={{
|
|
102
|
+
isActive: active,
|
|
103
|
+
transitions,
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<div id={id} style={{ flex: 1, position: "relative", ...style || {} }} className={classes.join(" ")}>
|
|
107
|
+
{children}
|
|
108
|
+
</div>
|
|
109
|
+
</SubslideContext.Provider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-constructed-context-values */
|
|
2
|
+
// TODO: Remove above
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { ScrollableArea, Subslide } from "./index.js";
|
|
5
|
+
import { useAsyncReference, useModes } from "../hooks";
|
|
6
|
+
|
|
7
|
+
import { SubslidesContext } from "../contexts.js";
|
|
8
|
+
|
|
9
|
+
export function Subslides({ children, animateSpeed }) {
|
|
10
|
+
const [currentSubslide, setCurrentSubslide] = useAsyncReference(1);
|
|
11
|
+
const [animating, setAnimating] = useState({
|
|
12
|
+
up: false,
|
|
13
|
+
down: false,
|
|
14
|
+
});
|
|
15
|
+
const { isScreenshot } = useModes();
|
|
16
|
+
|
|
17
|
+
let totalSubslides = 0;
|
|
18
|
+
|
|
19
|
+
function mapSubslide(child, index) {
|
|
20
|
+
totalSubslides++;
|
|
21
|
+
return React.cloneElement(child, {
|
|
22
|
+
id: `subslide-${index + 1}`,
|
|
23
|
+
style: { height: "100%" },
|
|
24
|
+
setSubslide: (index) => {
|
|
25
|
+
setAnimating({
|
|
26
|
+
down: index > currentSubslide.current,
|
|
27
|
+
up: index < currentSubslide.current,
|
|
28
|
+
});
|
|
29
|
+
setCurrentSubslide(index);
|
|
30
|
+
},
|
|
31
|
+
endAnimation: () => {
|
|
32
|
+
setAnimating({ down: false, up: false });
|
|
33
|
+
},
|
|
34
|
+
animateSpeed: isScreenshot ? 0 : animateSpeed,
|
|
35
|
+
index: index + 1,
|
|
36
|
+
active: index + 1 === currentSubslide.current,
|
|
37
|
+
key: index,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const newChildren = React.Children.map(children, (child, index) => {
|
|
42
|
+
if (child.type === Subslide) {
|
|
43
|
+
return mapSubslide(child, index);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (child.type === ScrollableArea) {
|
|
47
|
+
return React.cloneElement(child, {
|
|
48
|
+
children: React.Children.map(child.props.children, mapSubslide),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return child;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<SubslidesContext.Provider
|
|
57
|
+
value={{
|
|
58
|
+
animating,
|
|
59
|
+
currentSubslideIndex: currentSubslide.current,
|
|
60
|
+
totalSubslides: totalSubslides,
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{newChildren}
|
|
64
|
+
</SubslidesContext.Provider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Subslides.defaultProps = {
|
|
69
|
+
animateSpeed: 500,
|
|
70
|
+
};
|
|
71
|
+
|
package/lib/contexts.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const SlideContext = React.createContext({
|
|
4
|
+
transitions: null,
|
|
5
|
+
slideKey: null,
|
|
6
|
+
isCurrentSlide: false,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const SubslidesContext = React.createContext({
|
|
10
|
+
animating: {
|
|
11
|
+
up: false,
|
|
12
|
+
down: false
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const SubslideContext = React.createContext({
|
|
17
|
+
transitions: null,
|
|
18
|
+
isActive: false
|
|
19
|
+
});
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export function useAsyncReference(value, isProp = false) {
|
|
4
|
+
const ref = useRef(value);
|
|
5
|
+
const [, forceRender] = useState(false);
|
|
6
|
+
|
|
7
|
+
function updateState(newState) {
|
|
8
|
+
if (!Object.is(ref.current, newState)) {
|
|
9
|
+
ref.current = newState;
|
|
10
|
+
forceRender((s) => !s);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (isProp) {
|
|
15
|
+
ref.current = value;
|
|
16
|
+
return ref;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return [ref, updateState];
|
|
20
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import isPlainObject from "lodash.isplainobject";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useSharedState } from "./index.js";
|
|
4
|
+
|
|
5
|
+
function getValueFromContext(context, path, defaultValue) {
|
|
6
|
+
if (path) {
|
|
7
|
+
return Bridge.Context.get(path, defaultValue);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function useContext(contextPath = null, defaultValue = null) {
|
|
14
|
+
let persist = false;
|
|
15
|
+
let path = contextPath;
|
|
16
|
+
|
|
17
|
+
const value = getValueFromContext(
|
|
18
|
+
window.Bridge.Context.getDict(),
|
|
19
|
+
path,
|
|
20
|
+
defaultValue
|
|
21
|
+
);
|
|
22
|
+
const [context, setContextState] = useSharedState(value);
|
|
23
|
+
|
|
24
|
+
// You could pass in an object, so that you can set whether
|
|
25
|
+
// the saves are persistent or not.
|
|
26
|
+
if (isPlainObject(contextPath)) {
|
|
27
|
+
path = contextPath.path || null;
|
|
28
|
+
persist = contextPath.save || false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function setContext(key, data) {
|
|
32
|
+
let setPath = key;
|
|
33
|
+
let setData = data;
|
|
34
|
+
|
|
35
|
+
if (path) {
|
|
36
|
+
if (data) {
|
|
37
|
+
setPath = `${path}.${key}`;
|
|
38
|
+
} else {
|
|
39
|
+
setPath = path;
|
|
40
|
+
setData = key;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Bridge.Context.set(setPath, setData, persist);
|
|
45
|
+
|
|
46
|
+
const value = getValueFromContext(
|
|
47
|
+
Bridge.Context.getDict(),
|
|
48
|
+
path,
|
|
49
|
+
defaultValue
|
|
50
|
+
);
|
|
51
|
+
setContextState(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (context !== value) {
|
|
56
|
+
Bridge.Context.set(path, context, persist);
|
|
57
|
+
}
|
|
58
|
+
}, [context]);
|
|
59
|
+
|
|
60
|
+
return [context, setContext];
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function useModes() {
|
|
2
|
+
const bodyClasses = [...document.body.classList];
|
|
3
|
+
|
|
4
|
+
const isMaster = bodyClasses.includes("master");
|
|
5
|
+
const isClient = bodyClasses.includes("client");
|
|
6
|
+
const isOnline = bodyClasses.includes("online");
|
|
7
|
+
const isScreenshot = bodyClasses.includes("screenshot");
|
|
8
|
+
const isShareOnline = bodyClasses.includes("share_online");
|
|
9
|
+
const isPreview = bodyClasses.includes("preview");
|
|
10
|
+
const isRemote = isOnline && isClient && !isShareOnline;
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
isMaster,
|
|
14
|
+
isClient,
|
|
15
|
+
isOnline,
|
|
16
|
+
isRemote,
|
|
17
|
+
isScreenshot,
|
|
18
|
+
isPreview,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useAsyncReference, useModes } from "./index.js";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
import ulog from "ulog";
|
|
5
|
+
|
|
6
|
+
const log = ulog("use-root-slide");
|
|
7
|
+
|
|
8
|
+
const DEFAULT_TRANSITION_STATE = {
|
|
9
|
+
entering: false,
|
|
10
|
+
entered: false,
|
|
11
|
+
exiting: false,
|
|
12
|
+
exited: true,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* For use only at the root of the app (inside the router).
|
|
17
|
+
* Passes through information for the rest of the slide to use
|
|
18
|
+
* in the context.
|
|
19
|
+
*
|
|
20
|
+
* Not available from the package directly, as it shouldn't be
|
|
21
|
+
* needed.
|
|
22
|
+
*/
|
|
23
|
+
export function useRootSlide(article) {
|
|
24
|
+
const { isRemote, isClient, isMaster } = useModes();
|
|
25
|
+
const key = article.data("slide-key");
|
|
26
|
+
const isCurrent = article.closest(".presoSlide").hasClass("current");
|
|
27
|
+
const [synced, setSynced] = useState(!isRemote);
|
|
28
|
+
const [internalSlideState, setInternalSlideState] = useAsyncReference({});
|
|
29
|
+
const [slideReady, setSlideReady] = useState(false);
|
|
30
|
+
|
|
31
|
+
const [transitions, setTransitions] = useState({
|
|
32
|
+
...DEFAULT_TRANSITION_STATE,
|
|
33
|
+
entered: isCurrent,
|
|
34
|
+
exited: !isCurrent,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const updateState = (stateName) => (e) => {
|
|
38
|
+
setTransitions({
|
|
39
|
+
...DEFAULT_TRANSITION_STATE,
|
|
40
|
+
[stateName]: true,
|
|
41
|
+
exited: stateName === "slide:exited",
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const CLIENT_GET_EVENT = `client:get-all-state:${key}`;
|
|
46
|
+
const MASTER_SEND_EVENT = `master:send-all-state:${key}`;
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
let interval;
|
|
50
|
+
|
|
51
|
+
if (slideReady && isCurrent && !synced && isRemote) {
|
|
52
|
+
interval = setInterval(() => {
|
|
53
|
+
log.debug("Asking master for data...");
|
|
54
|
+
if (Bridge) {
|
|
55
|
+
Bridge.Event.trigger(CLIENT_GET_EVENT);
|
|
56
|
+
} else {
|
|
57
|
+
clearInterval(interval);
|
|
58
|
+
}
|
|
59
|
+
}, 1000);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
if (interval) {
|
|
64
|
+
clearInterval(interval);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [slideReady, synced]);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const clientGetEvent = () => {
|
|
71
|
+
const data = internalSlideState.current;
|
|
72
|
+
Bridge.Event.trigger(MASTER_SEND_EVENT, data);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function masterSendEvent(data) {
|
|
76
|
+
log.debug("Received data from master!", data);
|
|
77
|
+
setInternalSlideState({ ...internalSlideState.current, ...data });
|
|
78
|
+
setSynced(true);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (slideReady) {
|
|
82
|
+
if (isClient) {
|
|
83
|
+
if (!synced) {
|
|
84
|
+
Bridge.Event.trigger(CLIENT_GET_EVENT);
|
|
85
|
+
}
|
|
86
|
+
Bridge.Event.on(MASTER_SEND_EVENT, masterSendEvent);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (isMaster) {
|
|
90
|
+
Bridge.Event.on(CLIENT_GET_EVENT, clientGetEvent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return () => {
|
|
95
|
+
if (Bridge) {
|
|
96
|
+
Bridge.Event.off(CLIENT_GET_EVENT, clientGetEvent);
|
|
97
|
+
Bridge.Event.off(MASTER_SEND_EVENT, masterSendEvent);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}, [slideReady]);
|
|
101
|
+
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const slideEntering = updateState("entering");
|
|
104
|
+
const slideEntered = updateState("entered");
|
|
105
|
+
const slideExiting = updateState("exiting");
|
|
106
|
+
const slideExited = updateState("exited");
|
|
107
|
+
|
|
108
|
+
article.on("slide:entering", slideEntering);
|
|
109
|
+
article.on("slide:entered", slideEntered);
|
|
110
|
+
article.on("slide:exiting", slideExiting);
|
|
111
|
+
article.on("slide:exited", slideExited);
|
|
112
|
+
article.on("slideready", (e) => {
|
|
113
|
+
setSlideReady(true);
|
|
114
|
+
slideEntered(e);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return () => {
|
|
118
|
+
article.off();
|
|
119
|
+
};
|
|
120
|
+
}, [slideReady]);
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
isSlideReady: slideReady,
|
|
124
|
+
transitions,
|
|
125
|
+
slideKey: key,
|
|
126
|
+
isCurrentSlide: isCurrent,
|
|
127
|
+
rootElement: article.get(0),
|
|
128
|
+
|
|
129
|
+
// For use by shared state
|
|
130
|
+
internalSlideState,
|
|
131
|
+
setInternalSlideState,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useContext, useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
import { SlideContext } from "../contexts.js";
|
|
4
|
+
import get from "lodash.get";
|
|
5
|
+
import { useModes } from "./index.js";
|
|
6
|
+
|
|
7
|
+
const internalIDCache = {};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Automatically share state between master/client.
|
|
11
|
+
* Where the master's state changes, the clients will
|
|
12
|
+
* automagically update too.
|
|
13
|
+
*/
|
|
14
|
+
export function useSharedState(initialValue) {
|
|
15
|
+
const { isClient, isMaster } = useModes();
|
|
16
|
+
const {
|
|
17
|
+
internalSlideState,
|
|
18
|
+
setInternalSlideState,
|
|
19
|
+
slideKey,
|
|
20
|
+
isSlideReady,
|
|
21
|
+
} = useContext(SlideContext);
|
|
22
|
+
|
|
23
|
+
const eventID = useRef(isMaster);
|
|
24
|
+
const currentState = eventID.current
|
|
25
|
+
? get(internalSlideState.current, eventID.current, initialValue)
|
|
26
|
+
: initialValue;
|
|
27
|
+
|
|
28
|
+
function setData(data) {
|
|
29
|
+
setInternalSlideState({
|
|
30
|
+
...internalSlideState.current,
|
|
31
|
+
[eventID.current]: data,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!internalIDCache[slideKey]) {
|
|
37
|
+
internalIDCache[slideKey] = {
|
|
38
|
+
_index: 0,
|
|
39
|
+
loadedIDs: [],
|
|
40
|
+
receivedState: false,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const cache = internalIDCache[slideKey];
|
|
45
|
+
const id = ++cache._index;
|
|
46
|
+
const _eventID = `${slideKey}:${id}`;
|
|
47
|
+
cache.loadedIDs.push(id);
|
|
48
|
+
|
|
49
|
+
eventID.current = _eventID;
|
|
50
|
+
|
|
51
|
+
const MASTER_CHANGE_EVENT = `master:state-changed:${_eventID}`;
|
|
52
|
+
|
|
53
|
+
function masterStateChanged(data) {
|
|
54
|
+
setData(data);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (isClient) {
|
|
58
|
+
Bridge.Event.on(MASTER_CHANGE_EVENT, masterStateChanged);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
Bridge.Event.off(MASTER_CHANGE_EVENT, masterStateChanged);
|
|
63
|
+
|
|
64
|
+
cache.loadedIDs.splice(cache.loadedIDs.indexOf(id), 1);
|
|
65
|
+
if (!cache.loadedIDs.length) {
|
|
66
|
+
cache._index = 0;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, [isSlideReady]);
|
|
70
|
+
|
|
71
|
+
function setSharedData(data) {
|
|
72
|
+
if (isMaster) {
|
|
73
|
+
Bridge.Event.trigger(`master:state-changed:${eventID.current}`, data);
|
|
74
|
+
setData(data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// No-op if client... for now!
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return [currentState, setSharedData];
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SubslidesContext } from "../contexts.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
export function useSubslides() {
|
|
5
|
+
const context = useContext(SubslidesContext);
|
|
6
|
+
const index = context.currentSubslideIndex;
|
|
7
|
+
|
|
8
|
+
const atTop = index === 1;
|
|
9
|
+
const atBottom = index === context.totalSubslides;
|
|
10
|
+
return {
|
|
11
|
+
...context,
|
|
12
|
+
atTop,
|
|
13
|
+
atBottom,
|
|
14
|
+
navigateUp() {
|
|
15
|
+
if (atTop) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Bridge.Sub.show(`subslide-${index - 1}`);
|
|
20
|
+
},
|
|
21
|
+
navigateDown() {
|
|
22
|
+
if (atBottom) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Bridge.Sub.show(`subslide-${index + 1}`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SlideContext } from "../contexts.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { useModes } from "./index.js";
|
|
4
|
+
|
|
5
|
+
export function useTransitions() {
|
|
6
|
+
const { isScreenshot } = useModes();
|
|
7
|
+
const { entering, exiting, entered } = useContext(SlideContext).transitions;
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
entering: isScreenshot ? false : entering,
|
|
11
|
+
exiting: isScreenshot ? false : exiting,
|
|
12
|
+
entered: isScreenshot ? true : entered,
|
|
13
|
+
};
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@livepreso/content-react",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@livepreso/eslint-config": "~1.0.0",
|
|
14
|
+
"@rushstack/eslint-config": "~2.4.0",
|
|
15
|
+
"@babel/preset-react": "~7.14.5"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"react": "~17.0.2",
|
|
19
|
+
"react-dom": "~17.0.2",
|
|
20
|
+
"@livepreso/content-base": "~0.0.2",
|
|
21
|
+
"ulog": "~2.0.0-beta.18",
|
|
22
|
+
"lodash.get": "~4.4.2",
|
|
23
|
+
"lodash.isplainobject": "~4.0.6"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": ""
|
|
27
|
+
}
|
|
28
|
+
}
|