@livepreso/content-react 1.0.2 → 1.1.1
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/.rush/temp/shrinkwrap-deps.json +14 -3
- package/CHANGELOG.json +35 -0
- package/CHANGELOG.md +21 -1
- package/eslint.config.mjs +3 -0
- package/index.js +12 -13
- package/lib/components/CompanywideJSON.js +1 -1
- package/lib/components/OverlayPortal.js +10 -0
- package/lib/components/index.js +1 -0
- package/lib/contexts.js +1 -0
- package/lib/hooks/cmsvals.js +126 -0
- package/lib/hooks/cwe-editable.js +1 -6
- package/lib/hooks/index.js +7 -2
- package/lib/hooks/prep-editable.js +35 -42
- package/lib/hooks/{use-slide.js → slide.js} +15 -0
- package/lib/hooks/use-editable-field-key.js +1 -1
- package/lib/hooks/use-editable-initial-state.js +1 -1
- package/lib/hooks/use-modes.js +5 -4
- package/lib/hooks/use-root-slide.js +19 -11
- package/lib/hooks/use-slide-context.js +17 -18
- package/lib/hooks/use-slide-done.js +1 -1
- package/lib/hooks/use-slide-ready.js +1 -1
- package/lib/hooks/use-subslides.js +1 -1
- package/lib/hooks/use-transitions.js +9 -7
- package/lib/utils.js +6 -2
- package/package.json +2 -2
- package/.rush/temp/package-deps_build.json +0 -26
- package/.rush/temp/package-deps_test.json +0 -26
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
"../../content/content-react": "../../content/content-react:LI4QvLCR+A7lRqOhNBgyXxl132hAY0Q+y0icexYILvQ=:",
|
|
3
3
|
"/@ampproject/remapping@2.3.0": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
|
|
4
4
|
"/@babel/code-frame@7.26.2": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
|
|
5
|
+
"/@babel/code-frame@7.27.1": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
|
|
5
6
|
"/@babel/compat-data@7.26.2": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==",
|
|
6
7
|
"/@babel/core@7.26.0": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==",
|
|
7
8
|
"/@babel/generator@7.26.2": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==",
|
|
9
|
+
"/@babel/generator@7.28.0": "sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==",
|
|
8
10
|
"/@babel/helper-annotate-as-pure@7.25.9": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==",
|
|
9
11
|
"/@babel/helper-compilation-targets@7.25.9": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==",
|
|
12
|
+
"/@babel/helper-globals@7.28.0": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
|
|
10
13
|
"/@babel/helper-module-imports@7.25.9": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==",
|
|
11
14
|
"/@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==",
|
|
12
15
|
"/@babel/helper-plugin-utils@7.25.9": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==",
|
|
13
16
|
"/@babel/helper-string-parser@7.25.9": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==",
|
|
17
|
+
"/@babel/helper-string-parser@7.27.1": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
|
|
14
18
|
"/@babel/helper-validator-identifier@7.25.9": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
|
|
19
|
+
"/@babel/helper-validator-identifier@7.27.1": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==",
|
|
15
20
|
"/@babel/helper-validator-option@7.25.9": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==",
|
|
16
21
|
"/@babel/helpers@7.26.0": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==",
|
|
17
|
-
"/@babel/parser@7.
|
|
22
|
+
"/@babel/parser@7.28.0": "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==",
|
|
18
23
|
"/@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.0)": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==",
|
|
19
24
|
"/@babel/plugin-transform-react-display-name@7.25.9(@babel/core@7.26.0)": "sha512-KJfMlYIUxQB1CJfO3e0+h0ZHWOTLCPP115Awhaz8U0Zpq36Gl/cXlpoyMRnUWlhNUBAzldnCiAZNvCDj7CrKxQ==",
|
|
20
25
|
"/@babel/plugin-transform-react-jsx-development@7.25.9(@babel/core@7.26.0)": "sha512-9mj6rm7XVYs4mdLIpbZnHOYdpW42uoiBCTVowg7sP1thUOiANgMb4UtpRivR0pp5iL+ocvUv7X4mZgFRpJEzGw==",
|
|
@@ -22,8 +27,10 @@
|
|
|
22
27
|
"/@babel/plugin-transform-react-pure-annotations@7.25.9(@babel/core@7.26.0)": "sha512-KQ/Takk3T8Qzj5TppkS1be588lkbTp5uj7w6a0LeQaTMSckU/wK0oJ/pih+T690tkgI5jfmg2TqDJvd41Sj1Cg==",
|
|
23
28
|
"/@babel/preset-react@7.25.9(@babel/core@7.26.0)": "sha512-D3to0uSPiWE7rBrdIICCd0tJSIGpLaaGptna2+w7Pft5xMqLpA1sz99DK5TZ1TjGbdQ/VI1eCSZ06dv3lT4JOw==",
|
|
24
29
|
"/@babel/template@7.25.9": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==",
|
|
25
|
-
"/@babel/
|
|
30
|
+
"/@babel/template@7.27.2": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
|
|
31
|
+
"/@babel/traverse@7.28.0": "sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==",
|
|
26
32
|
"/@babel/types@7.26.0": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==",
|
|
33
|
+
"/@babel/types@7.28.2": "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==",
|
|
27
34
|
"/@eslint-community/eslint-utils@4.4.1(eslint@9.15.0)": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==",
|
|
28
35
|
"/@eslint-community/regexpp@4.12.1": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
|
|
29
36
|
"/@eslint/config-array@0.19.0": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==",
|
|
@@ -37,11 +44,13 @@
|
|
|
37
44
|
"/@humanwhocodes/module-importer@1.0.1": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
|
|
38
45
|
"/@humanwhocodes/retry@0.3.1": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
|
|
39
46
|
"/@humanwhocodes/retry@0.4.1": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==",
|
|
47
|
+
"/@jridgewell/gen-mapping@0.3.13": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
|
|
40
48
|
"/@jridgewell/gen-mapping@0.3.5": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
|
|
41
49
|
"/@jridgewell/resolve-uri@3.1.2": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
|
42
50
|
"/@jridgewell/set-array@1.2.1": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
|
|
43
51
|
"/@jridgewell/sourcemap-codec@1.5.0": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
|
44
52
|
"/@jridgewell/trace-mapping@0.3.25": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
|
|
53
|
+
"/@jridgewell/trace-mapping@0.3.30": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==",
|
|
45
54
|
"/@types/estree@1.0.6": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
|
|
46
55
|
"/@types/json-schema@7.0.15": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
|
|
47
56
|
"/acorn-jsx@5.3.2(acorn@8.14.0)": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
|
|
@@ -62,6 +71,7 @@
|
|
|
62
71
|
"/convert-source-map@2.0.0": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
|
|
63
72
|
"/cross-spawn@7.0.6": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
|
64
73
|
"/debug@4.3.7(supports-color@8.1.1)": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
|
74
|
+
"/debug@4.4.0(supports-color@5.5.0)": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
|
65
75
|
"/deep-is@0.1.4": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
|
|
66
76
|
"/electron-to-chromium@1.5.65": "sha512-PWVzBjghx7/wop6n22vS2MLU8tKGd4Q91aCEGhG/TYmW6PP5OcSXcdnxTe1NNt0T66N8D6jxh4kC8UsdzOGaIw==",
|
|
67
77
|
"/escalade@3.2.0": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
|
|
@@ -84,8 +94,8 @@
|
|
|
84
94
|
"/flatted@3.3.2": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==",
|
|
85
95
|
"/gensync@1.0.0-beta.2": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
|
|
86
96
|
"/glob-parent@6.0.2": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
|
|
87
|
-
"/globals@11.12.0": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
|
88
97
|
"/globals@14.0.0": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
|
98
|
+
"/has-flag@3.0.0": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
|
89
99
|
"/has-flag@4.0.0": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
|
90
100
|
"/ignore@5.3.2": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
|
|
91
101
|
"/import-fresh@3.3.0": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
|
|
@@ -133,6 +143,7 @@
|
|
|
133
143
|
"/shebang-command@2.0.0": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
|
134
144
|
"/shebang-regex@3.0.0": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
|
135
145
|
"/strip-json-comments@3.1.1": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
|
|
146
|
+
"/supports-color@5.5.0": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
|
136
147
|
"/supports-color@7.2.0": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
137
148
|
"/supports-color@8.1.1": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
|
138
149
|
"/type-check@0.4.0": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
|
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/content-react",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "1.1.1",
|
|
6
|
+
"tag": "@livepreso/content-react_v1.1.1",
|
|
7
|
+
"date": "Mon, 25 Aug 2025 09:37:11 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Bump version of ulog"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "(cmsvals) change test for PM preview "
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "1.1.0",
|
|
21
|
+
"tag": "@livepreso/content-react_v1.1.0",
|
|
22
|
+
"date": "Tue, 08 Jul 2025 01:48:30 GMT",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "Add support for getting/setting cmsvals (and user templates)"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"patch": [
|
|
30
|
+
{
|
|
31
|
+
"comment": "User templates temp key correctly regexed"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"comment": "useSlideContext always updates state on context change"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
4
39
|
{
|
|
5
40
|
"version": "1.0.2",
|
|
6
41
|
"tag": "@livepreso/content-react_v1.0.2",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
# Change Log - @livepreso/content-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 25 Aug 2025 09:37:11 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 1.1.1
|
|
6
|
+
Mon, 25 Aug 2025 09:37:11 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- Bump version of ulog
|
|
11
|
+
- (cmsvals) change test for PM preview
|
|
12
|
+
|
|
13
|
+
## 1.1.0
|
|
14
|
+
Tue, 08 Jul 2025 01:48:30 GMT
|
|
15
|
+
|
|
16
|
+
### Minor changes
|
|
17
|
+
|
|
18
|
+
- Add support for getting/setting cmsvals (and user templates)
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- User templates temp key correctly regexed
|
|
23
|
+
- useSlideContext always updates state on context change
|
|
4
24
|
|
|
5
25
|
## 1.0.2
|
|
6
26
|
Wed, 25 Jun 2025 23:57:00 GMT
|
package/eslint.config.mjs
CHANGED
package/index.js
CHANGED
|
@@ -57,30 +57,29 @@ export class App extends AppBase {
|
|
|
57
57
|
|
|
58
58
|
defaultRenderer(Slide, article) {
|
|
59
59
|
const el = article.get(0);
|
|
60
|
+
const id = el.id;
|
|
60
61
|
|
|
61
|
-
if (window.__deck_roots__[
|
|
62
|
-
this.unmountRoot(
|
|
62
|
+
if (window.__deck_roots__[id]) {
|
|
63
|
+
this.unmountRoot(id);
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
const root = createRoot(el);
|
|
66
67
|
|
|
67
|
-
window.__deck_roots__[
|
|
68
|
+
window.__deck_roots__[id] = root;
|
|
69
|
+
|
|
70
|
+
function slideClosed() {
|
|
71
|
+
root.unmount();
|
|
72
|
+
delete window.__deck_roots__[id];
|
|
73
|
+
article.off("slide:closed", slideClosed);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
article.on("slide:closed", slideClosed);
|
|
68
77
|
|
|
69
78
|
const RootApp = this.rootApp(Slide);
|
|
70
79
|
const AppComponent = () => {
|
|
71
80
|
// TODO: Refactor this to be a prop
|
|
72
81
|
const slideState = useRootSlide(article);
|
|
73
82
|
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
function slideClosed() {
|
|
76
|
-
root.unmount();
|
|
77
|
-
delete window.__deck_roots__[el.id];
|
|
78
|
-
article.off("slide:closed", slideClosed);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
article.on("slide:closed", slideClosed);
|
|
82
|
-
}, []);
|
|
83
|
-
|
|
84
83
|
return (
|
|
85
84
|
<SlideContext.Provider value={slideState}>
|
|
86
85
|
{!slideState.transitions.exited && (
|
|
@@ -4,7 +4,7 @@ import { CompanywideJSONContext } from "../contexts.js";
|
|
|
4
4
|
import set from "lodash.set";
|
|
5
5
|
import unescape from "lodash.unescape";
|
|
6
6
|
import { useEditableInitialState } from "../hooks/use-editable-initial-state.js";
|
|
7
|
-
import { useSlide } from "../hooks/
|
|
7
|
+
import { useSlide } from "../hooks/slide.js";
|
|
8
8
|
import { getCWEJSONKey, testCWEJSONExists } from "../utils.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTransitions } from "../hooks";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
|
|
4
|
+
export function OverlayPortal({ children }) {
|
|
5
|
+
const { entered, exiting, exited } = useTransitions();
|
|
6
|
+
if ((!entered && !exiting) || exited) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
return createPortal(children, window.Bridge.UI.overlay);
|
|
10
|
+
}
|
package/lib/components/index.js
CHANGED
package/lib/contexts.js
CHANGED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { useTransitions } from "./use-transitions";
|
|
3
|
+
import { useSlideContext } from "./use-slide-context.js";
|
|
4
|
+
import { useSlide, useSlideModel } from "./slide.js";
|
|
5
|
+
import { useModes } from "./use-modes.js";
|
|
6
|
+
|
|
7
|
+
function useUserTemplateCMS(name) {
|
|
8
|
+
const { slideID, presentationKey, isUserTemplate, isUserTemplateLibrary } =
|
|
9
|
+
useSlide();
|
|
10
|
+
|
|
11
|
+
let contextKey;
|
|
12
|
+
|
|
13
|
+
if (isUserTemplate) {
|
|
14
|
+
contextKey = `_userTemplateCMSvals.${slideID}--${name}-${presentationKey}`;
|
|
15
|
+
} else if (isUserTemplateLibrary) {
|
|
16
|
+
contextKey = `_userTemplateCMSvals.${presentationKey}--${name}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const [obj, setValue] = useSlideContext(
|
|
20
|
+
contextKey,
|
|
21
|
+
{ mime: "text/plain", value: null },
|
|
22
|
+
{ enabled: !!contextKey },
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
obj?.value ?? null,
|
|
27
|
+
contextKey
|
|
28
|
+
? (value) => setValue({ value, mime: "text/plain" })
|
|
29
|
+
: () => {
|
|
30
|
+
console.warn("Not a user template, can't set value");
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function useDefaultCMSValueFromPresomanager(name, { slidePath = null } = {}) {
|
|
36
|
+
const { isPresomanager } = useModes();
|
|
37
|
+
const model = useSlideModel({ slidePath });
|
|
38
|
+
|
|
39
|
+
let key;
|
|
40
|
+
if (model.autoAdjunctID) {
|
|
41
|
+
key = `${name}-autoadjunct-${model.autoAdjunctID}`;
|
|
42
|
+
} else {
|
|
43
|
+
key = name;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const [cmsVals] = useSlideContext(
|
|
47
|
+
"_cmsVals",
|
|
48
|
+
{ mime: "text/plain", value: null },
|
|
49
|
+
// TODO: Presets? Previews?
|
|
50
|
+
{ enabled: !isPresomanager },
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return cmsVals?.find?.((c) => c.key === key)?.value ?? null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function useCMSVal(name, { enabled = true, slidePath = null } = {}) {
|
|
57
|
+
const { entered, entering } = useTransitions();
|
|
58
|
+
const { isPresomanager, isEmptyPreview } = useModes();
|
|
59
|
+
const { isUserTemplate, isUserTemplateLibrary } = useSlide();
|
|
60
|
+
const [userTemplateValue, setUserTemplateValue] = useUserTemplateCMS(name);
|
|
61
|
+
const defaultFromPM = useDefaultCMSValueFromPresomanager(name, { slidePath });
|
|
62
|
+
|
|
63
|
+
// We need to make sure we aren't trying to call this bridge command
|
|
64
|
+
// (which can be specific to this slide) while it's being removed,
|
|
65
|
+
// otherwise we might throw warnings about missing cmsval keys.
|
|
66
|
+
const isActiveSlide = entered || entering;
|
|
67
|
+
|
|
68
|
+
const getCmsVal = useCallback(() => {
|
|
69
|
+
if (!enabled || !name || !isActiveSlide) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (isUserTemplate || isUserTemplateLibrary) {
|
|
74
|
+
return userTemplateValue;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!isPresomanager && !isEmptyPreview) {
|
|
78
|
+
return defaultFromPM;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return Bridge.CMSVals.get(name, { slidePath });
|
|
82
|
+
}, [
|
|
83
|
+
enabled,
|
|
84
|
+
name,
|
|
85
|
+
defaultFromPM,
|
|
86
|
+
isUserTemplate,
|
|
87
|
+
isUserTemplateLibrary,
|
|
88
|
+
isActiveSlide,
|
|
89
|
+
isPresomanager,
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
const [value, setCMSValue] = useState(getCmsVal());
|
|
93
|
+
|
|
94
|
+
function updateCMSVal(value) {
|
|
95
|
+
if (isUserTemplate) {
|
|
96
|
+
setUserTemplateValue(value);
|
|
97
|
+
} else {
|
|
98
|
+
Bridge.CMSVals.set(name, value, { slidePath });
|
|
99
|
+
}
|
|
100
|
+
setCMSValue(value);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (!enabled || !isActiveSlide) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function onCMSValChanged(key, newValue) {
|
|
109
|
+
const fullKey = Bridge.CMSVals.getFullKey(name, { slidePath });
|
|
110
|
+
|
|
111
|
+
if (key !== fullKey) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
setCMSValue(newValue);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
Bridge.presenter.getPresentation().on("cmsValChanged", onCMSValChanged);
|
|
119
|
+
|
|
120
|
+
return () => {
|
|
121
|
+
Bridge.presenter.getPresentation().off("cmsValChanged", onCMSValChanged);
|
|
122
|
+
};
|
|
123
|
+
}, [enabled, name, getCmsVal]);
|
|
124
|
+
|
|
125
|
+
return [value, updateCMSVal];
|
|
126
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import { useModes } from "./use-modes";
|
|
4
|
-
import { useSlide } from "./
|
|
4
|
+
import { useSlide } from "./slide";
|
|
5
5
|
import { useEditableFieldKey } from "./use-editable-field-key";
|
|
6
6
|
import { getCWEData, getUserTemplateData } from "../utils";
|
|
7
7
|
|
|
@@ -41,11 +41,6 @@ export function useCWEEditableInfo(id) {
|
|
|
41
41
|
|
|
42
42
|
function updateValue() {
|
|
43
43
|
const newValue = getValue();
|
|
44
|
-
|
|
45
|
-
if (value === newValue) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
44
|
setValue(newValue);
|
|
50
45
|
}
|
|
51
46
|
|
package/lib/hooks/index.js
CHANGED
|
@@ -4,11 +4,16 @@ export { useAsyncReference } from "./use-async-reference.js";
|
|
|
4
4
|
export { useModes } from "./use-modes.js";
|
|
5
5
|
export { useSlideContext } from "./use-slide-context.js";
|
|
6
6
|
export { useCompanywide } from "./use-companywide.js";
|
|
7
|
-
export { useSlide } from "./
|
|
7
|
+
export { useSlideModel, useSlide } from "./slide.js";
|
|
8
8
|
export { useTransitions } from "./use-transitions.js";
|
|
9
9
|
export { useSubslides } from "./use-subslides.js";
|
|
10
10
|
export { useSlideDone } from "./use-slide-done.js";
|
|
11
11
|
export { useEditableFieldKey } from "./use-editable-field-key.js";
|
|
12
12
|
export { useEditableInitialState } from "./use-editable-initial-state.js";
|
|
13
|
-
export {
|
|
13
|
+
export {
|
|
14
|
+
usePrepEditable,
|
|
15
|
+
usePrepEditableInfo,
|
|
16
|
+
usePrepEditableValue,
|
|
17
|
+
} from "./prep-editable.js";
|
|
14
18
|
export { useCWEEditableInfo, useCWEEditableValue } from "./cwe-editable.js";
|
|
19
|
+
export { useCMSVal } from "./cmsvals.js";
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
|
|
3
1
|
import { useModes } from "./use-modes";
|
|
4
|
-
import { useSlide } from "./
|
|
2
|
+
import { useSlide } from "./slide";
|
|
3
|
+
import { useSlideContext } from "./use-slide-context";
|
|
5
4
|
import { useEditableFieldKey } from "./use-editable-field-key";
|
|
6
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Get and set values for use by templates, in a way that it will magically
|
|
8
|
+
* work with user templates especially. Values get placed in a special part
|
|
9
|
+
* of the context to allow the user template magic to work, and this is the
|
|
10
|
+
* function to use to make that seamless.
|
|
11
|
+
*/
|
|
12
|
+
export function usePrepEditable(editableKey) {
|
|
13
|
+
const { isPresomanager } = useModes();
|
|
14
|
+
const { slideID, isUserTemplateLibrary } = useSlide();
|
|
15
|
+
|
|
16
|
+
const key = useEditableFieldKey(editableKey, { isPrep: true });
|
|
17
|
+
|
|
18
|
+
const prepKey = `${slideID}--${key}`;
|
|
19
|
+
const keyPath = `_editableContent.${prepKey}`;
|
|
20
|
+
|
|
21
|
+
const [obj, setObj] = useSlideContext(
|
|
22
|
+
keyPath,
|
|
23
|
+
{
|
|
24
|
+
mime: "text/plain",
|
|
25
|
+
value: null,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
enabled: !isPresomanager || isUserTemplateLibrary,
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return [obj?.value ?? null, (value) => setObj({ mime: "text/plain", value })];
|
|
33
|
+
}
|
|
34
|
+
|
|
7
35
|
/**
|
|
8
36
|
* Returns information about a prep editable on the current slide.
|
|
9
37
|
*
|
|
@@ -12,7 +40,7 @@ import { useEditableFieldKey } from "./use-editable-field-key";
|
|
|
12
40
|
*
|
|
13
41
|
* Example:
|
|
14
42
|
*
|
|
15
|
-
*
|
|
43
|
+
* usePrepEditableInfo("test");
|
|
16
44
|
* => {
|
|
17
45
|
* key: "test",
|
|
18
46
|
* value: "User edited text",
|
|
@@ -20,49 +48,13 @@ import { useEditableFieldKey } from "./use-editable-field-key";
|
|
|
20
48
|
* }
|
|
21
49
|
*/
|
|
22
50
|
export function usePrepEditableInfo(id) {
|
|
23
|
-
const { isPresomanager } = useModes();
|
|
24
|
-
const { slideID } = useSlide();
|
|
25
|
-
|
|
26
51
|
const key = useEditableFieldKey(id, { isPrep: true });
|
|
27
|
-
|
|
28
|
-
const prepKey = `${slideID}--${key}`;
|
|
29
|
-
const keyPath = `_editableContent.${prepKey}.value`;
|
|
30
|
-
|
|
31
|
-
const getValue = useCallback(() => {
|
|
32
|
-
return Bridge.Context.get(keyPath, null);
|
|
33
|
-
}, [keyPath]);
|
|
34
|
-
|
|
35
|
-
const [value, setValue] = useState(getValue());
|
|
36
|
-
|
|
37
|
-
function updateValue() {
|
|
38
|
-
const newValue = getValue();
|
|
39
|
-
|
|
40
|
-
if (value === newValue) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
setValue(newValue);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (isPresomanager) return;
|
|
49
|
-
|
|
50
|
-
function onContextChange() {
|
|
51
|
-
updateValue();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
Bridge.presenter.getPresentation().on("change:context", onContextChange);
|
|
55
|
-
|
|
56
|
-
return () => {
|
|
57
|
-
Bridge.presenter.getPresentation().off("change:context", onContextChange);
|
|
58
|
-
};
|
|
59
|
-
}, [isPresomanager, value, getValue]);
|
|
52
|
+
const [value] = usePrepEditable(id);
|
|
60
53
|
|
|
61
54
|
return {
|
|
62
55
|
key,
|
|
63
56
|
value: value,
|
|
64
57
|
hasValue: value !== null,
|
|
65
|
-
updateValue,
|
|
66
58
|
};
|
|
67
59
|
}
|
|
68
60
|
|
|
@@ -70,5 +62,6 @@ export function usePrepEditableInfo(id) {
|
|
|
70
62
|
* Returns the current value of a prep editable on the current slide.
|
|
71
63
|
*/
|
|
72
64
|
export function usePrepEditableValue(id, defaultValue = null) {
|
|
73
|
-
|
|
65
|
+
const [value] = usePrepEditable(id);
|
|
66
|
+
return value ?? defaultValue;
|
|
74
67
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { SlideContext } from "../contexts.js";
|
|
2
3
|
import { useContext } from "react";
|
|
3
4
|
|
|
@@ -13,6 +14,7 @@ export function useSlide() {
|
|
|
13
14
|
currentSubslide,
|
|
14
15
|
transitions,
|
|
15
16
|
isUserTemplate,
|
|
17
|
+
isUserTemplateLibrary,
|
|
16
18
|
isPMTemplate,
|
|
17
19
|
} = useContext(SlideContext);
|
|
18
20
|
|
|
@@ -27,6 +29,19 @@ export function useSlide() {
|
|
|
27
29
|
totalSubslides,
|
|
28
30
|
transitions,
|
|
29
31
|
isUserTemplate,
|
|
32
|
+
isUserTemplateLibrary,
|
|
30
33
|
isPMTemplate,
|
|
31
34
|
};
|
|
32
35
|
}
|
|
36
|
+
|
|
37
|
+
export function useSlideModel({ slidePath = null } = {}) {
|
|
38
|
+
const { slideID } = useSlide();
|
|
39
|
+
|
|
40
|
+
return useMemo(() => {
|
|
41
|
+
const presentation = Bridge.presenter.getPresentation();
|
|
42
|
+
if (slidePath) {
|
|
43
|
+
return presentation.search(slidePath);
|
|
44
|
+
}
|
|
45
|
+
return presentation.current;
|
|
46
|
+
}, [slidePath, slideID]);
|
|
47
|
+
}
|
package/lib/hooks/use-modes.js
CHANGED
|
@@ -12,10 +12,11 @@ export function useModes() {
|
|
|
12
12
|
const isPreview = bodyClasses.includes("preview");
|
|
13
13
|
const isPresent = bodyClasses.includes("present");
|
|
14
14
|
const isReview = bodyClasses.includes("review");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const isPresomanager =
|
|
16
|
+
// Editing user templates in prep results in both the 'preview' and 'edit-mode'
|
|
17
|
+
// classes being added to the body. In order to detect if we are truly on the
|
|
18
|
+
// PresoManager page in the app, we need to ignore the 'preview' class.
|
|
19
|
+
bodyClasses.includes("edit-mode") && !isPreview;
|
|
19
20
|
const isEmptyPreview = bodyClasses.includes("empty-preview");
|
|
20
21
|
const isRemote = isOnline && isClient && !isShareOnline;
|
|
21
22
|
const isCdk = typeof window.__cdk_version__ !== "undefined";
|
|
@@ -115,26 +115,32 @@ export function useRootSlide(article) {
|
|
|
115
115
|
const slideEntered = updateState("entered");
|
|
116
116
|
const slideExiting = updateState("exiting");
|
|
117
117
|
const slideExited = updateState("exited");
|
|
118
|
-
|
|
119
|
-
article.off();
|
|
120
|
-
article.on("slide:entering", slideEntering);
|
|
121
|
-
article.on("slide:entered", slideEntered);
|
|
122
|
-
article.on("slide:exiting", slideExiting);
|
|
123
|
-
article.on("slide:exited", slideExited);
|
|
124
|
-
article.on("slide:closed", () => {
|
|
118
|
+
const slideClosed = () => {
|
|
125
119
|
doneRegister.current.promises = [];
|
|
126
|
-
}
|
|
127
|
-
|
|
120
|
+
};
|
|
121
|
+
const slideReady = (e, done) => {
|
|
128
122
|
Promise.all(doneRegister.current.promises).then(() => {
|
|
129
123
|
done();
|
|
130
124
|
});
|
|
131
125
|
|
|
132
126
|
setSlideReady(true);
|
|
133
127
|
slideEntered(e);
|
|
134
|
-
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
article.on("slide:entering", slideEntering);
|
|
131
|
+
article.on("slide:entered", slideEntered);
|
|
132
|
+
article.on("slide:exiting", slideExiting);
|
|
133
|
+
article.on("slide:exited", slideExited);
|
|
134
|
+
article.on("slide:closed", slideClosed);
|
|
135
|
+
article.on("slideready", slideReady);
|
|
135
136
|
|
|
136
137
|
return () => {
|
|
137
|
-
article.off();
|
|
138
|
+
article.off("slide:entering", slideEntering);
|
|
139
|
+
article.off("slide:entered", slideEntered);
|
|
140
|
+
article.off("slide:exiting", slideExiting);
|
|
141
|
+
article.off("slide:exited", slideExited);
|
|
142
|
+
article.off("slide:closed", slideClosed);
|
|
143
|
+
article.off("slideready", slideReady);
|
|
138
144
|
};
|
|
139
145
|
}, [slideReady]);
|
|
140
146
|
|
|
@@ -161,6 +167,8 @@ export function useRootSlide(article) {
|
|
|
161
167
|
doneRegister,
|
|
162
168
|
rootElement: article.get(0),
|
|
163
169
|
isUserTemplate: slideID.startsWith("adjunct-template-slide"),
|
|
170
|
+
isUserTemplateLibrary:
|
|
171
|
+
slideID.startsWith("template-") && !slideID.startsWith("template-slide"),
|
|
164
172
|
isPMTemplate: slideID.startsWith("template-slide"),
|
|
165
173
|
|
|
166
174
|
registerSubslide: () => setTotalSubslides(totalSubslides.current + 1),
|
|
@@ -3,28 +3,24 @@ import { useEffect, useState, useCallback } from "react";
|
|
|
3
3
|
import { useModes } from "./use-modes";
|
|
4
4
|
|
|
5
5
|
import isPlainObject from "lodash.isplainobject";
|
|
6
|
-
import isEqual from "lodash.isequal";
|
|
7
6
|
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return context;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function useSlideContext(contextPath = null, defaultValue = null) {
|
|
7
|
+
export function useSlideContext(
|
|
8
|
+
contextPath = null,
|
|
9
|
+
defaultValue = null,
|
|
10
|
+
{ enabled = true } = {},
|
|
11
|
+
) {
|
|
17
12
|
let persist = false;
|
|
18
13
|
let path = contextPath;
|
|
19
14
|
|
|
20
15
|
const { isPresomanager } = useModes();
|
|
21
16
|
|
|
17
|
+
// useCallback to prevent useEffect from re-rendering
|
|
22
18
|
const getValue = useCallback(() => {
|
|
23
|
-
|
|
24
|
-
window.Bridge.Context.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
19
|
+
if (path) {
|
|
20
|
+
return window.Bridge.Context.get(path, defaultValue);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return window.Bridge.Context.getDict();
|
|
28
24
|
}, [path, defaultValue]);
|
|
29
25
|
|
|
30
26
|
const [context, setContextState] = useState(getValue);
|
|
@@ -37,6 +33,10 @@ export function useSlideContext(contextPath = null, defaultValue = null) {
|
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
function setContext(key, data) {
|
|
36
|
+
if (!enabled) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
40
|
let setPath = key;
|
|
41
41
|
let setData = data;
|
|
42
42
|
|
|
@@ -53,11 +53,10 @@ export function useSlideContext(contextPath = null, defaultValue = null) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
useEffect(() => {
|
|
56
|
-
if (isPresomanager) return;
|
|
56
|
+
if (isPresomanager || !enabled) return;
|
|
57
57
|
|
|
58
58
|
function onContextChange() {
|
|
59
59
|
const newValue = getValue();
|
|
60
|
-
if (isEqual(context, newValue)) return;
|
|
61
60
|
setContextState(newValue);
|
|
62
61
|
}
|
|
63
62
|
|
|
@@ -66,7 +65,7 @@ export function useSlideContext(contextPath = null, defaultValue = null) {
|
|
|
66
65
|
return () => {
|
|
67
66
|
Bridge.presenter.getPresentation().off("change:context", onContextChange);
|
|
68
67
|
};
|
|
69
|
-
}, [isPresomanager, context, getValue]);
|
|
68
|
+
}, [enabled, isPresomanager, context, getValue]);
|
|
70
69
|
|
|
71
70
|
return [context, setContext];
|
|
72
71
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SlideContext, SubslideContext } from "../contexts.js";
|
|
2
2
|
|
|
3
3
|
import { useContext } from "react";
|
|
4
|
-
import { useSlide } from "./
|
|
4
|
+
import { useSlide } from "./slide.js";
|
|
5
5
|
|
|
6
6
|
export function useSubslides() {
|
|
7
7
|
const context = useContext(SubslideContext);
|
|
@@ -3,12 +3,14 @@ import { useContext } from "react";
|
|
|
3
3
|
import { useModes } from "./index.js";
|
|
4
4
|
|
|
5
5
|
export function useTransitions() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const { isScreenshot } = useModes();
|
|
7
|
+
const { entering, exiting, exited, entered } =
|
|
8
|
+
useContext(SlideContext).transitions;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return {
|
|
11
|
+
entering: isScreenshot ? false : entering,
|
|
12
|
+
exiting: isScreenshot ? false : exiting,
|
|
13
|
+
entered: isScreenshot ? true : entered,
|
|
14
|
+
exited,
|
|
15
|
+
};
|
|
14
16
|
}
|
package/lib/utils.js
CHANGED
|
@@ -99,11 +99,15 @@ export function getPMTemplateFieldKey(key, slideID) {
|
|
|
99
99
|
* @returns {string} - The constructed field key for the user template.
|
|
100
100
|
*/
|
|
101
101
|
export function getUserTemplateFieldKey(key, slideID) {
|
|
102
|
-
const
|
|
102
|
+
const numericRegex = /-(\d+)(?:-temp)*$/;
|
|
103
|
+
const slideNumericID = slideID.match(numericRegex)?.[1];
|
|
104
|
+
|
|
103
105
|
const isUnsavedTemplate = slideID.indexOf("-tempkey") > -1;
|
|
104
106
|
|
|
105
107
|
if (isUnsavedTemplate) {
|
|
106
|
-
|
|
108
|
+
const numericRegex = /tempkey-((?:[\d\w])+)/;
|
|
109
|
+
const tempID = slideID.match(numericRegex)?.[1];
|
|
110
|
+
return `${key}-tempkey-${tempID}`;
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
return `${key}-adjunct-${slideNumericID}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/content-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react": "~18.2.0",
|
|
19
19
|
"react-dom": "~18.2.0",
|
|
20
20
|
"@livepreso/content-base": "~1.1.8",
|
|
21
|
-
"ulog": "~2.0.0-beta.
|
|
21
|
+
"ulog": "~2.0.0-beta.19",
|
|
22
22
|
"lodash.get": "~4.4.2",
|
|
23
23
|
"lodash.isplainobject": "~4.0.6",
|
|
24
24
|
"lodash.set": "~4.3.2",
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|