@pie-element/inline-dropdown 11.0.5-esm.0 → 11.0.5-next.20261012010413
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/author.js +2 -0
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/defaults.d.ts +187 -0
- package/dist/author/defaults.js +130 -0
- package/dist/author/index.d.ts +25 -0
- package/dist/author/index.js +91 -0
- package/dist/author/inline-dropdown-toolbar.d.ts +44 -0
- package/dist/author/inline-dropdown-toolbar.js +269 -0
- package/dist/author/main.d.ts +65 -0
- package/dist/author/main.js +363 -0
- package/dist/author/markupUtils.d.ts +4 -0
- package/dist/author/markupUtils.js +23 -0
- package/dist/author/response-area.d.ts +12 -0
- package/dist/author/response-area.js +32 -0
- package/dist/author/utils.d.ts +2 -0
- package/dist/author/utils.js +10 -0
- package/dist/browser/Close-V6zXg6OM.js +12945 -0
- package/dist/browser/Close-V6zXg6OM.js.map +1 -0
- package/dist/browser/PUA-tLuTiQ7---_oZ5q_A.js +4370 -0
- package/dist/browser/PUA-tLuTiQ7---_oZ5q_A.js.map +1 -0
- package/dist/browser/accents-BTUYmhn9-BvG-5D5U.js +1508 -0
- package/dist/browser/accents-BTUYmhn9-BvG-5D5U.js.map +1 -0
- package/dist/browser/accents-b-i-CngHZsLL-D9VyhQb6.js +2847 -0
- package/dist/browser/accents-b-i-CngHZsLL-D9VyhQb6.js.map +1 -0
- package/dist/browser/arabic-BzEHMVZD-Dynlj189.js +785 -0
- package/dist/browser/arabic-BzEHMVZD-Dynlj189.js.map +1 -0
- package/dist/browser/arrows-VjxlU-jv-DSm4SIYN.js +2655 -0
- package/dist/browser/arrows-VjxlU-jv-DSm4SIYN.js.map +1 -0
- package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/author/index.js +36618 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/braille-BeWC_Ruq-T-5kTNil.js +1287 -0
- package/dist/browser/braille-BeWC_Ruq-T-5kTNil.js.map +1 -0
- package/dist/browser/braille-d-Dk6J96GO--ZdfI9kr.js +1287 -0
- package/dist/browser/braille-d-Dk6J96GO--ZdfI9kr.js.map +1 -0
- package/dist/browser/calligraphic-Cew9cU3x-qfCrrm3u.js +323 -0
- package/dist/browser/calligraphic-Cew9cU3x-qfCrrm3u.js.map +1 -0
- package/dist/browser/cherokee-Cny3FYho-CbTYre7_.js +2029 -0
- package/dist/browser/cherokee-Cny3FYho-CbTYre7_.js.map +1 -0
- package/dist/browser/chtml-CbqemTOM-x0_YISTK.js +20329 -0
- package/dist/browser/chtml-CbqemTOM-x0_YISTK.js.map +1 -0
- package/dist/browser/controller/index.js +198 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/cyrillic-CfCDulXU-EvNL2rHi.js +5617 -0
- package/dist/browser/cyrillic-CfCDulXU-EvNL2rHi.js.map +1 -0
- package/dist/browser/cyrillic-ss-lU7bNGG9-jdxJx-EF.js +5606 -0
- package/dist/browser/cyrillic-ss-lU7bNGG9-jdxJx-EF.js.map +1 -0
- package/dist/browser/delivery/index.js +1307 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/devanagari-CDIz2h-r-FGcUsKu2.js +692 -0
- package/dist/browser/devanagari-CDIz2h-r-FGcUsKu2.js.map +1 -0
- package/dist/browser/dist-FMIRkZir.js +753 -0
- package/dist/browser/dist-FMIRkZir.js.map +1 -0
- package/dist/browser/double-struck-BpJEQk8y-CLqFtvAN.js +438 -0
- package/dist/browser/double-struck-BpJEQk8y-CLqFtvAN.js.map +1 -0
- package/dist/browser/editor-runtime/Close-C0bNS2Kx.js +12945 -0
- package/dist/browser/editor-runtime/Close-C0bNS2Kx.js.map +1 -0
- package/dist/browser/editor-runtime/PUA-tLuTiQ7---_oZ5q_A.js +4370 -0
- package/dist/browser/editor-runtime/PUA-tLuTiQ7---_oZ5q_A.js.map +1 -0
- package/dist/browser/editor-runtime/accents-BTUYmhn9-BvG-5D5U.js +1508 -0
- package/dist/browser/editor-runtime/accents-BTUYmhn9-BvG-5D5U.js.map +1 -0
- package/dist/browser/editor-runtime/accents-b-i-CngHZsLL-D9VyhQb6.js +2847 -0
- package/dist/browser/editor-runtime/accents-b-i-CngHZsLL-D9VyhQb6.js.map +1 -0
- package/dist/browser/editor-runtime/arabic-BzEHMVZD-Dynlj189.js +785 -0
- package/dist/browser/editor-runtime/arabic-BzEHMVZD-Dynlj189.js.map +1 -0
- package/dist/browser/editor-runtime/arrows-VjxlU-jv-DSm4SIYN.js +2655 -0
- package/dist/browser/editor-runtime/arrows-VjxlU-jv-DSm4SIYN.js.map +1 -0
- package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/editor-runtime/author/index.js +20030 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/braille-BeWC_Ruq-T-5kTNil.js +1287 -0
- package/dist/browser/editor-runtime/braille-BeWC_Ruq-T-5kTNil.js.map +1 -0
- package/dist/browser/editor-runtime/braille-d-Dk6J96GO--ZdfI9kr.js +1287 -0
- package/dist/browser/editor-runtime/braille-d-Dk6J96GO--ZdfI9kr.js.map +1 -0
- package/dist/browser/editor-runtime/calligraphic-Cew9cU3x-qfCrrm3u.js +323 -0
- package/dist/browser/editor-runtime/calligraphic-Cew9cU3x-qfCrrm3u.js.map +1 -0
- package/dist/browser/editor-runtime/cherokee-Cny3FYho-CbTYre7_.js +2029 -0
- package/dist/browser/editor-runtime/cherokee-Cny3FYho-CbTYre7_.js.map +1 -0
- package/dist/browser/editor-runtime/chtml-CbqemTOM-x0_YISTK.js +20329 -0
- package/dist/browser/editor-runtime/chtml-CbqemTOM-x0_YISTK.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +198 -0
- package/dist/browser/editor-runtime/controller/index.js.map +1 -0
- package/dist/browser/editor-runtime/cyrillic-CfCDulXU-EvNL2rHi.js +5617 -0
- package/dist/browser/editor-runtime/cyrillic-CfCDulXU-EvNL2rHi.js.map +1 -0
- package/dist/browser/editor-runtime/cyrillic-ss-lU7bNGG9-jdxJx-EF.js +5606 -0
- package/dist/browser/editor-runtime/cyrillic-ss-lU7bNGG9-jdxJx-EF.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +1307 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/browser/editor-runtime/devanagari-CDIz2h-r-FGcUsKu2.js +692 -0
- package/dist/browser/editor-runtime/devanagari-CDIz2h-r-FGcUsKu2.js.map +1 -0
- package/dist/browser/editor-runtime/dist-FMIRkZir.js +753 -0
- package/dist/browser/editor-runtime/dist-FMIRkZir.js.map +1 -0
- package/dist/browser/editor-runtime/double-struck-BpJEQk8y-CLqFtvAN.js +438 -0
- package/dist/browser/editor-runtime/double-struck-BpJEQk8y-CLqFtvAN.js.map +1 -0
- package/dist/browser/editor-runtime/fraktur-rLEq9DEH-BU0iR4xw.js +694 -0
- package/dist/browser/editor-runtime/fraktur-rLEq9DEH-BU0iR4xw.js.map +1 -0
- package/dist/browser/editor-runtime/greek-BlraJTyL-DAfjxxNh.js +9335 -0
- package/dist/browser/editor-runtime/greek-BlraJTyL-DAfjxxNh.js.map +1 -0
- package/dist/browser/editor-runtime/greek-ss-D-EN2PK0-CcyaecGS.js +6767 -0
- package/dist/browser/editor-runtime/greek-ss-D-EN2PK0-CcyaecGS.js.map +1 -0
- package/dist/browser/editor-runtime/hebrew-GiQZeybp-DqJrAkkB.js +3218 -0
- package/dist/browser/editor-runtime/hebrew-GiQZeybp-DqJrAkkB.js.map +1 -0
- package/dist/browser/editor-runtime/latin-b-BhEnC7R2-CQAVv0CI.js +3134 -0
- package/dist/browser/editor-runtime/latin-b-BhEnC7R2-CQAVv0CI.js.map +1 -0
- package/dist/browser/editor-runtime/latin-bi-DqiIKv3U-DM22wSUP.js +3637 -0
- package/dist/browser/editor-runtime/latin-bi-DqiIKv3U-DM22wSUP.js.map +1 -0
- package/dist/browser/editor-runtime/latin-i-B1xtwaE1-uBpJAGjo.js +3634 -0
- package/dist/browser/editor-runtime/latin-i-B1xtwaE1-uBpJAGjo.js.map +1 -0
- package/dist/browser/editor-runtime/latin-xfWFlLkD-CKElfDKc.js +3266 -0
- package/dist/browser/editor-runtime/latin-xfWFlLkD-CKElfDKc.js.map +1 -0
- package/dist/browser/editor-runtime/marrows-DD1NgMQi-BIBP-NrK.js +761 -0
- package/dist/browser/editor-runtime/marrows-DD1NgMQi-BIBP-NrK.js.map +1 -0
- package/dist/browser/editor-runtime/math-DpWn1mbG-B7Krt7Jk.js +2034 -0
- package/dist/browser/editor-runtime/math-DpWn1mbG-B7Krt7Jk.js.map +1 -0
- package/dist/browser/editor-runtime/mathjax-CptWnMbQ-BymmkoDr.js +36692 -0
- package/dist/browser/editor-runtime/mathjax-CptWnMbQ-BymmkoDr.js.map +1 -0
- package/dist/browser/editor-runtime/monospace-D116QD2a-C40p3Rv8.js +1112 -0
- package/dist/browser/editor-runtime/monospace-D116QD2a-C40p3Rv8.js.map +1 -0
- package/dist/browser/editor-runtime/monospace-ex-DcXpouKS-DkaktwPJ.js +6014 -0
- package/dist/browser/editor-runtime/monospace-ex-DcXpouKS-DkaktwPJ.js.map +1 -0
- package/dist/browser/editor-runtime/monospace-l-Ct5wkMDs-CuE7t5pv.js +3114 -0
- package/dist/browser/editor-runtime/monospace-l-Ct5wkMDs-CuE7t5pv.js.map +1 -0
- package/dist/browser/editor-runtime/mshapes-DCp86WSX-DX0WfJid.js +524 -0
- package/dist/browser/editor-runtime/mshapes-DCp86WSX-DX0WfJid.js.map +1 -0
- package/dist/browser/editor-runtime/phonetics-BwOCw2Y9-lJWnARqt.js +2496 -0
- package/dist/browser/editor-runtime/phonetics-BwOCw2Y9-lJWnARqt.js.map +1 -0
- package/dist/browser/editor-runtime/phonetics-ss-CRtMn02f-Cr32SJLL.js +2984 -0
- package/dist/browser/editor-runtime/phonetics-ss-CRtMn02f-Cr32SJLL.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-BYPZKlE9-DftjSdim.js +5246 -0
- package/dist/browser/editor-runtime/sans-serif-BYPZKlE9-DftjSdim.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-b-B0kRKiC--BsRQiyQP.js +3176 -0
- package/dist/browser/editor-runtime/sans-serif-b-B0kRKiC--BsRQiyQP.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-bi-DXWul6mu-D4NuD72A.js +3688 -0
- package/dist/browser/editor-runtime/sans-serif-bi-DXWul6mu-D4NuD72A.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-ex-Boux1kMP-BrL4RNcD.js +10033 -0
- package/dist/browser/editor-runtime/sans-serif-ex-Boux1kMP-BrL4RNcD.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-i-676RFaSO-BCRikTTw.js +3635 -0
- package/dist/browser/editor-runtime/sans-serif-i-676RFaSO-BCRikTTw.js.map +1 -0
- package/dist/browser/editor-runtime/sans-serif-r-DrN9xdZt-CN8omxfu.js +3159 -0
- package/dist/browser/editor-runtime/sans-serif-r-DrN9xdZt-CN8omxfu.js.map +1 -0
- package/dist/browser/editor-runtime/script-0ohehnXc-4G2PiBkk.js +649 -0
- package/dist/browser/editor-runtime/script-0ohehnXc-4G2PiBkk.js.map +1 -0
- package/dist/browser/editor-runtime/shapes-BG47NodJ-D3eH0HjT.js +1932 -0
- package/dist/browser/editor-runtime/shapes-BG47NodJ-D3eH0HjT.js.map +1 -0
- package/dist/browser/editor-runtime/speech-worker-CTpOB9m5-pwCKeQ9c.js +160 -0
- package/dist/browser/editor-runtime/speech-worker-CTpOB9m5-pwCKeQ9c.js.map +1 -0
- package/dist/browser/editor-runtime/symbols-BqnUxf_t-DJHA_nO7.js +1833 -0
- package/dist/browser/editor-runtime/symbols-BqnUxf_t-DJHA_nO7.js.map +1 -0
- package/dist/browser/editor-runtime/symbols-b-i-eg9k5hmF-Bn-dxZT_.js +1153 -0
- package/dist/browser/editor-runtime/symbols-b-i-eg9k5hmF-Bn-dxZT_.js.map +1 -0
- package/dist/browser/editor-runtime/variants-2LRNhOUP-BlL4NIVJ.js +231 -0
- package/dist/browser/editor-runtime/variants-2LRNhOUP-BlL4NIVJ.js.map +1 -0
- package/dist/browser/fraktur-rLEq9DEH-BU0iR4xw.js +694 -0
- package/dist/browser/fraktur-rLEq9DEH-BU0iR4xw.js.map +1 -0
- package/dist/browser/greek-BlraJTyL-DAfjxxNh.js +9335 -0
- package/dist/browser/greek-BlraJTyL-DAfjxxNh.js.map +1 -0
- package/dist/browser/greek-ss-D-EN2PK0-CcyaecGS.js +6767 -0
- package/dist/browser/greek-ss-D-EN2PK0-CcyaecGS.js.map +1 -0
- package/dist/browser/hebrew-GiQZeybp-DqJrAkkB.js +3218 -0
- package/dist/browser/hebrew-GiQZeybp-DqJrAkkB.js.map +1 -0
- package/dist/browser/latin-b-BhEnC7R2-CQAVv0CI.js +3134 -0
- package/dist/browser/latin-b-BhEnC7R2-CQAVv0CI.js.map +1 -0
- package/dist/browser/latin-bi-DqiIKv3U-DM22wSUP.js +3637 -0
- package/dist/browser/latin-bi-DqiIKv3U-DM22wSUP.js.map +1 -0
- package/dist/browser/latin-i-B1xtwaE1-uBpJAGjo.js +3634 -0
- package/dist/browser/latin-i-B1xtwaE1-uBpJAGjo.js.map +1 -0
- package/dist/browser/latin-xfWFlLkD-CKElfDKc.js +3266 -0
- package/dist/browser/latin-xfWFlLkD-CKElfDKc.js.map +1 -0
- package/dist/browser/marrows-DD1NgMQi-BIBP-NrK.js +761 -0
- package/dist/browser/marrows-DD1NgMQi-BIBP-NrK.js.map +1 -0
- package/dist/browser/math-DpWn1mbG-B7Krt7Jk.js +2034 -0
- package/dist/browser/math-DpWn1mbG-B7Krt7Jk.js.map +1 -0
- package/dist/browser/mathjax-CptWnMbQ-ncPHVakS.js +36692 -0
- package/dist/browser/mathjax-CptWnMbQ-ncPHVakS.js.map +1 -0
- package/dist/browser/monospace-D116QD2a-C40p3Rv8.js +1112 -0
- package/dist/browser/monospace-D116QD2a-C40p3Rv8.js.map +1 -0
- package/dist/browser/monospace-ex-DcXpouKS-DkaktwPJ.js +6014 -0
- package/dist/browser/monospace-ex-DcXpouKS-DkaktwPJ.js.map +1 -0
- package/dist/browser/monospace-l-Ct5wkMDs-CuE7t5pv.js +3114 -0
- package/dist/browser/monospace-l-Ct5wkMDs-CuE7t5pv.js.map +1 -0
- package/dist/browser/mshapes-DCp86WSX-DX0WfJid.js +524 -0
- package/dist/browser/mshapes-DCp86WSX-DX0WfJid.js.map +1 -0
- package/dist/browser/phonetics-BwOCw2Y9-lJWnARqt.js +2496 -0
- package/dist/browser/phonetics-BwOCw2Y9-lJWnARqt.js.map +1 -0
- package/dist/browser/phonetics-ss-CRtMn02f-Cr32SJLL.js +2984 -0
- package/dist/browser/phonetics-ss-CRtMn02f-Cr32SJLL.js.map +1 -0
- package/dist/browser/sans-serif-BYPZKlE9-DftjSdim.js +5246 -0
- package/dist/browser/sans-serif-BYPZKlE9-DftjSdim.js.map +1 -0
- package/dist/browser/sans-serif-b-B0kRKiC--BsRQiyQP.js +3176 -0
- package/dist/browser/sans-serif-b-B0kRKiC--BsRQiyQP.js.map +1 -0
- package/dist/browser/sans-serif-bi-DXWul6mu-D4NuD72A.js +3688 -0
- package/dist/browser/sans-serif-bi-DXWul6mu-D4NuD72A.js.map +1 -0
- package/dist/browser/sans-serif-ex-Boux1kMP-BrL4RNcD.js +10033 -0
- package/dist/browser/sans-serif-ex-Boux1kMP-BrL4RNcD.js.map +1 -0
- package/dist/browser/sans-serif-i-676RFaSO-BCRikTTw.js +3635 -0
- package/dist/browser/sans-serif-i-676RFaSO-BCRikTTw.js.map +1 -0
- package/dist/browser/sans-serif-r-DrN9xdZt-CN8omxfu.js +3159 -0
- package/dist/browser/sans-serif-r-DrN9xdZt-CN8omxfu.js.map +1 -0
- package/dist/browser/script-0ohehnXc-4G2PiBkk.js +649 -0
- package/dist/browser/script-0ohehnXc-4G2PiBkk.js.map +1 -0
- package/dist/browser/shapes-BG47NodJ-D3eH0HjT.js +1932 -0
- package/dist/browser/shapes-BG47NodJ-D3eH0HjT.js.map +1 -0
- package/dist/browser/speech-worker-CTpOB9m5-BIgcSm3A.js +160 -0
- package/dist/browser/speech-worker-CTpOB9m5-BIgcSm3A.js.map +1 -0
- package/dist/browser/symbols-BqnUxf_t-DJHA_nO7.js +1833 -0
- package/dist/browser/symbols-BqnUxf_t-DJHA_nO7.js.map +1 -0
- package/dist/browser/symbols-b-i-eg9k5hmF-Bn-dxZT_.js +1153 -0
- package/dist/browser/symbols-b-i-eg9k5hmF-Bn-dxZT_.js.map +1 -0
- package/dist/browser/variants-2LRNhOUP-BlL4NIVJ.js +231 -0
- package/dist/browser/variants-2LRNhOUP-BlL4NIVJ.js.map +1 -0
- package/dist/controller/defaults.d.ts +19 -0
- package/dist/controller/defaults.js +21 -0
- package/dist/controller/index.d.ts +95 -0
- package/dist/controller/index.js +126 -0
- package/dist/controller/utils.d.ts +2 -0
- package/dist/controller/utils.js +13 -0
- package/dist/delivery/__tests__/inline-dropdown-language.test.d.ts +1 -0
- package/dist/delivery/index.d.ts +14 -0
- package/dist/delivery/index.js +64 -0
- package/dist/delivery/inline-dropdown.d.ts +30 -0
- package/dist/delivery/inline-dropdown.js +111 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.iife.d.ts +6 -0
- package/dist/index.iife.js +185 -0
- package/dist/index.js +2 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/dist/schemas/configuration.schema.json +414 -0
- package/dist/schemas/model.schema.json +453 -0
- package/dist/schemas/session.schema.json +43 -0
- package/dist/types.d.ts +164 -0
- package/package.json +96 -32
- package/CHANGELOG.json +0 -1082
- package/CHANGELOG.md +0 -3440
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -647
- package/configure/CHANGELOG.md +0 -3066
- package/configure/lib/defaults.js +0 -190
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -209
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/inline-dropdown-toolbar.js +0 -573
- package/configure/lib/inline-dropdown-toolbar.js.map +0 -1
- package/configure/lib/main.js +0 -753
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/markupUtils.js +0 -70
- package/configure/lib/markupUtils.js.map +0 -1
- package/configure/lib/response-area.js +0 -99
- package/configure/lib/response-area.js.map +0 -1
- package/configure/lib/utils.js +0 -33
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -22
- package/controller/CHANGELOG.json +0 -467
- package/controller/CHANGELOG.md +0 -2114
- package/controller/lib/defaults.js +0 -26
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -360
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -40
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -16
- package/docs/config-schema.json +0 -2854
- package/docs/config-schema.json.md +0 -2106
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -76
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -11
- package/docs/pie-schema.json +0 -1152
- package/docs/pie-schema.json.md +0 -814
- package/esm/configure.js +0 -1973
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -304
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -278
- package/esm/element.js.map +0 -1
- package/lib/index.js +0 -130
- package/lib/index.js.map +0 -1
- package/lib/inline-dropdown.js +0 -248
- package/lib/inline-dropdown.js.map +0 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { getPluginProps as e } from "./utils.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { renderMath as n } from "@pie-element/shared-math-rendering-mathjax";
|
|
4
|
+
import r from "react-dom";
|
|
5
|
+
import i from "prop-types";
|
|
6
|
+
import { isEmpty as a, isEqual as o } from "@pie-element/shared-lodash";
|
|
7
|
+
import { color as s } from "@pie-lib/render-ui";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import { styled as u } from "@mui/material/styles";
|
|
10
|
+
import d from "@pie-lib/editable-html-tip-tap";
|
|
11
|
+
import f from "@mui/icons-material/Add";
|
|
12
|
+
import p from "@mui/icons-material/Check";
|
|
13
|
+
import m from "@mui/icons-material/Close";
|
|
14
|
+
import h from "@mui/icons-material/Edit";
|
|
15
|
+
import g from "@mui/material/IconButton";
|
|
16
|
+
//#region src/author/inline-dropdown-toolbar.tsx
|
|
17
|
+
var _ = u("div")(() => ({
|
|
18
|
+
display: "flex",
|
|
19
|
+
alignItems: "flex-start",
|
|
20
|
+
position: "relative",
|
|
21
|
+
background: s.white(),
|
|
22
|
+
borderBottom: `1px solid ${s.border()}`,
|
|
23
|
+
"&:last-child": { borderRadius: "0 0 4px 4px" }
|
|
24
|
+
})), v = u("div")(({ theme: e }) => ({
|
|
25
|
+
display: "flex",
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
color: e.palette.common.white,
|
|
28
|
+
fontSize: e.typography.fontSize,
|
|
29
|
+
fontStyle: "normal",
|
|
30
|
+
position: "absolute",
|
|
31
|
+
transform: "translate(0, -50%)",
|
|
32
|
+
backgroundColor: s.correct(),
|
|
33
|
+
borderRadius: "50%",
|
|
34
|
+
top: e.spacing(2),
|
|
35
|
+
left: e.spacing(1),
|
|
36
|
+
zIndex: 3
|
|
37
|
+
})), y = u("div")(({ theme: e, correct: t }) => ({
|
|
38
|
+
flex: 1,
|
|
39
|
+
padding: e.spacing(.75),
|
|
40
|
+
paddingLeft: e.spacing(3.5),
|
|
41
|
+
...t && { background: s.correctSecondary() },
|
|
42
|
+
"& p": { margin: 0 }
|
|
43
|
+
})), b = u("div")(({ theme: e }) => ({
|
|
44
|
+
margin: e.spacing(.5),
|
|
45
|
+
display: "flex"
|
|
46
|
+
})), x = u(g)(({ theme: e }) => ({
|
|
47
|
+
fontSize: e.typography.fontSize,
|
|
48
|
+
padding: e.spacing(.5),
|
|
49
|
+
color: e.palette.common.black
|
|
50
|
+
})), S = class extends t.Component {
|
|
51
|
+
static propTypes = {
|
|
52
|
+
correct: i.bool.isRequired,
|
|
53
|
+
onClick: i.func.isRequired,
|
|
54
|
+
onRemoveChoice: i.func.isRequired,
|
|
55
|
+
onEditChoice: i.func.isRequired,
|
|
56
|
+
value: i.string.isRequired
|
|
57
|
+
};
|
|
58
|
+
onRemoveClick = (e) => {
|
|
59
|
+
let { onRemoveChoice: t } = this.props;
|
|
60
|
+
e.preventDefault(), e.stopPropagation(), t();
|
|
61
|
+
};
|
|
62
|
+
onEditClick = (e) => {
|
|
63
|
+
let { onEditChoice: t } = this.props;
|
|
64
|
+
e.preventDefault(), e.stopPropagation(), t();
|
|
65
|
+
};
|
|
66
|
+
render() {
|
|
67
|
+
let { correct: e, onClick: t, value: n } = this.props;
|
|
68
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
69
|
+
e && /* @__PURE__ */ c(v, {
|
|
70
|
+
onClick: t,
|
|
71
|
+
children: /* @__PURE__ */ c(p, { fontSize: "inherit" })
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ c(y, {
|
|
74
|
+
correct: e,
|
|
75
|
+
onClick: t,
|
|
76
|
+
dangerouslySetInnerHTML: { __html: n }
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ l(b, { children: [/* @__PURE__ */ c(x, {
|
|
79
|
+
onClick: this.onEditClick,
|
|
80
|
+
size: "small",
|
|
81
|
+
"aria-label": "Edit",
|
|
82
|
+
children: /* @__PURE__ */ c(h, { fontSize: "inherit" })
|
|
83
|
+
}), /* @__PURE__ */ c(x, {
|
|
84
|
+
onClick: this.onRemoveClick,
|
|
85
|
+
size: "small",
|
|
86
|
+
"aria-label": "Remove",
|
|
87
|
+
children: /* @__PURE__ */ c(m, { fontSize: "inherit" })
|
|
88
|
+
})] })
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
}, C = (e) => {
|
|
92
|
+
let t = document.createElement("div");
|
|
93
|
+
return t.innerHTML = (e || "").trim(), t;
|
|
94
|
+
}, w = u("div")(({ theme: e }) => ({
|
|
95
|
+
boxShadow: e.shadows[2],
|
|
96
|
+
borderRadius: "4px",
|
|
97
|
+
width: "400px"
|
|
98
|
+
})), T = u(d)(({ theme: e }) => ({
|
|
99
|
+
borderRadius: "4px",
|
|
100
|
+
backgroundColor: e.palette.common.white,
|
|
101
|
+
"& [data-slate-editor=\"true\"]": { minHeight: "initial !important" }
|
|
102
|
+
})), E = u(g)(({ theme: e }) => ({
|
|
103
|
+
fontSize: e.typography.fontSize + 2,
|
|
104
|
+
padding: e.spacing(.5),
|
|
105
|
+
color: e.palette.common.black,
|
|
106
|
+
position: "absolute",
|
|
107
|
+
top: "50%",
|
|
108
|
+
right: e.spacing(2),
|
|
109
|
+
transform: "translate(0, -50%)"
|
|
110
|
+
})), D = u("div")({
|
|
111
|
+
display: "flex",
|
|
112
|
+
flexDirection: "column",
|
|
113
|
+
"& > div:last-child": { border: "none" }
|
|
114
|
+
}), O = u("div")(({ theme: e }) => ({
|
|
115
|
+
padding: e.spacing(.5),
|
|
116
|
+
position: "relative"
|
|
117
|
+
})), k = class extends t.Component {
|
|
118
|
+
static propTypes = {
|
|
119
|
+
node: i.object,
|
|
120
|
+
pos: i.number,
|
|
121
|
+
uploadSoundSupport: i.object,
|
|
122
|
+
onDone: i.func,
|
|
123
|
+
choices: i.array,
|
|
124
|
+
onAddChoice: i.func.isRequired,
|
|
125
|
+
editorCallback: i.func,
|
|
126
|
+
onRemoveChoice: i.func.isRequired,
|
|
127
|
+
onSelectChoice: i.func.isRequired,
|
|
128
|
+
onToolbarDone: i.func.isRequired,
|
|
129
|
+
editor: i.object,
|
|
130
|
+
spellCheck: i.bool,
|
|
131
|
+
mathMlOptions: i.object,
|
|
132
|
+
baseInputConfiguration: i.object,
|
|
133
|
+
responseAreaInputConfiguration: i.object
|
|
134
|
+
};
|
|
135
|
+
clickedInside = !1;
|
|
136
|
+
preventDone = !1;
|
|
137
|
+
state = {
|
|
138
|
+
respAreaMarkup: "",
|
|
139
|
+
editedChoiceIndex: -1
|
|
140
|
+
};
|
|
141
|
+
componentDidMount() {
|
|
142
|
+
let { editor: e } = this.props, t = e.view.nodeDOM(e.state.selection.from);
|
|
143
|
+
if (t?.nodeType === 1) {
|
|
144
|
+
let e = t.getBoundingClientRect(), n = t.closest(".tiptap").getBoundingClientRect(), r = e.top - n.top, i = e.left - n.left;
|
|
145
|
+
this.setState({ toolbarStyle: {
|
|
146
|
+
position: "absolute",
|
|
147
|
+
top: `${r + e.height + 25}px`,
|
|
148
|
+
left: `${i}px`
|
|
149
|
+
} });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
componentDidUpdate() {
|
|
153
|
+
n(r.findDOMNode(this));
|
|
154
|
+
}
|
|
155
|
+
componentWillUnmount() {
|
|
156
|
+
this.commitPendingEdit();
|
|
157
|
+
}
|
|
158
|
+
commitPendingEdit = () => {
|
|
159
|
+
let { editedChoiceIndex: e } = this.state;
|
|
160
|
+
e < 0 || !this.editorRef?.getHTML || (this.preventDone = !1, this.onDone(this.editorRef.getHTML() || ""));
|
|
161
|
+
};
|
|
162
|
+
onRespAreaChange = (e) => {
|
|
163
|
+
this.setState({ respAreaMarkup: e });
|
|
164
|
+
};
|
|
165
|
+
onAddChoice = () => {
|
|
166
|
+
let { editor: e } = this.props, { tr: t } = e.state;
|
|
167
|
+
t.isDone = !0, e.view.dispatch(t);
|
|
168
|
+
};
|
|
169
|
+
onDone = (e) => {
|
|
170
|
+
let { choices: t, node: n, editor: r, onAddChoice: i, onToolbarDone: o } = this.props, { editedChoiceIndex: s } = this.state, c = C(e).textContent.trim();
|
|
171
|
+
s >= 0 && t?.[s]?.correct && r.commands.updateAttributes("inline_dropdown", { value: e }), a(c) || (i(n.attrs.index, e, s), r.commands.refreshResponseArea()), this.setState({ editedChoiceIndex: -1 });
|
|
172
|
+
};
|
|
173
|
+
onSelectChoice = (e, t) => {
|
|
174
|
+
let { node: n, editor: r, onToolbarDone: i, onSelectChoice: a } = this.props;
|
|
175
|
+
r.commands.updateAttributes("inline_dropdown", { value: e }), a(t), r.commands.refreshResponseArea();
|
|
176
|
+
};
|
|
177
|
+
onRemoveChoice = (e, t) => {
|
|
178
|
+
let { node: n, editor: r, onToolbarDone: i, onRemoveChoice: a } = this.props;
|
|
179
|
+
o(e, n.attrs.value) && r.commands.updateAttributes("inline_dropdown", { value: null }), a(t), r.commands.refreshResponseArea();
|
|
180
|
+
};
|
|
181
|
+
onEditChoice = (e, t) => {
|
|
182
|
+
let { editedChoiceIndex: n } = this.state;
|
|
183
|
+
if (this.clickedInside = !0, this.preventDone = !0, n >= 0) {
|
|
184
|
+
let e = this.editorRef.getHTML() || "";
|
|
185
|
+
this.onDone(e);
|
|
186
|
+
}
|
|
187
|
+
this.onRespAreaChange(e), this.setState({ editedChoiceIndex: t });
|
|
188
|
+
};
|
|
189
|
+
finishEditing = () => {
|
|
190
|
+
let e = this.editorRef.getHTML() || "";
|
|
191
|
+
this.onDone(e), this.preventDone = !0;
|
|
192
|
+
};
|
|
193
|
+
onKeyDown = (e) => e.key === "Enter" ? (this.finishEditing(), !0) : !1;
|
|
194
|
+
onBlur = () => {
|
|
195
|
+
if (this.clickedInside) {
|
|
196
|
+
this.clickedInside = !1;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
let { editedChoiceIndex: e } = this.state;
|
|
200
|
+
if (e >= 0) {
|
|
201
|
+
this.commitPendingEdit();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.onAddChoice();
|
|
205
|
+
};
|
|
206
|
+
onClickInside = () => {
|
|
207
|
+
this.clickedInside = !0;
|
|
208
|
+
};
|
|
209
|
+
render() {
|
|
210
|
+
let { choices: t, spellCheck: n, uploadSoundSupport: r, mathMlOptions: i = {}, baseInputConfiguration: a = {}, responseAreaInputConfiguration: o = {} } = this.props, { respAreaMarkup: u, toolbarStyle: d, editedChoiceIndex: m } = this.state;
|
|
211
|
+
return d ? /* @__PURE__ */ l(w, {
|
|
212
|
+
"data-inline-dropdown-toolbar": "",
|
|
213
|
+
style: {
|
|
214
|
+
...d,
|
|
215
|
+
backgroundColor: s.dropdownBackground(),
|
|
216
|
+
zIndex: 999
|
|
217
|
+
},
|
|
218
|
+
onMouseDown: this.onClickInside,
|
|
219
|
+
children: [/* @__PURE__ */ l(O, { children: [/* @__PURE__ */ c(T, {
|
|
220
|
+
editorRef: (e) => {
|
|
221
|
+
e && (this.editorRef = e, this.props.editorCallback?.(e));
|
|
222
|
+
},
|
|
223
|
+
autoFocus: !0,
|
|
224
|
+
autoSave: !0,
|
|
225
|
+
toolbarOpts: {
|
|
226
|
+
position: "top",
|
|
227
|
+
alwaysVisible: !1,
|
|
228
|
+
showDone: !1,
|
|
229
|
+
doneOn: "blur"
|
|
230
|
+
},
|
|
231
|
+
markup: u,
|
|
232
|
+
onKeyDown: this.onKeyDown,
|
|
233
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
234
|
+
onChange: (e) => {
|
|
235
|
+
this.preventDone || this.onRespAreaChange(e);
|
|
236
|
+
},
|
|
237
|
+
onDone: (e) => {
|
|
238
|
+
if (this.preventDone) {
|
|
239
|
+
this.preventDone = !1;
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
this.onDone(e);
|
|
243
|
+
},
|
|
244
|
+
onBlur: (e) => {
|
|
245
|
+
let t = !!(e.relatedTarget && e.relatedTarget.closest(".insert-character-dialog")), n = !!(e.relatedTarget && e.relatedTarget.closest("[aria-label=\"Done\"]"));
|
|
246
|
+
e.relatedTarget && (this.preventDone = t || n, (t || n) && (this.clickedInside = !0)), this.onBlur();
|
|
247
|
+
},
|
|
248
|
+
placeholder: "Add Choice",
|
|
249
|
+
pluginProps: e(o?.inputConfiguration, a),
|
|
250
|
+
spellCheck: n,
|
|
251
|
+
uploadSoundSupport: r,
|
|
252
|
+
mathMlOptions: i
|
|
253
|
+
}), /* @__PURE__ */ c(E, {
|
|
254
|
+
onClick: () => m >= 0 ? this.finishEditing() : this.onAddChoice(),
|
|
255
|
+
size: "small",
|
|
256
|
+
"aria-label": "Add",
|
|
257
|
+
children: c(m >= 0 ? p : f, { fontSize: "inherit" })
|
|
258
|
+
})] }), t && /* @__PURE__ */ c(D, { children: t.map(({ label: e, correct: t }, n) => /* @__PURE__ */ c(S, {
|
|
259
|
+
onClick: () => this.onSelectChoice(e, n),
|
|
260
|
+
onRemoveChoice: () => this.onRemoveChoice(e, n),
|
|
261
|
+
onEditChoice: () => this.onEditChoice(e, n),
|
|
262
|
+
value: e,
|
|
263
|
+
correct: t
|
|
264
|
+
}, n)) })]
|
|
265
|
+
}) : null;
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
//#endregion
|
|
269
|
+
export { k as default };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { InlineDropdownValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { Choice, Choices, InlineDropdownConfiguration, InlineDropdownModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<InlineDropdownModel> & {
|
|
7
|
+
choices: Choices;
|
|
8
|
+
markup: string;
|
|
9
|
+
slateMarkup: string;
|
|
10
|
+
errors?: InlineDropdownValidationErrors;
|
|
11
|
+
};
|
|
12
|
+
type MediaSupport<Handler> = {
|
|
13
|
+
add: (handler: Handler) => void;
|
|
14
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
15
|
+
};
|
|
16
|
+
export type MainProps = {
|
|
17
|
+
model: AuthorModel;
|
|
18
|
+
configuration: InlineDropdownConfiguration;
|
|
19
|
+
disableSidePanel?: boolean;
|
|
20
|
+
onModelChanged: (model: Partial<AuthorModel>, reset?: boolean) => void;
|
|
21
|
+
onConfigurationChanged: (configuration: InlineDropdownConfiguration, reset?: boolean) => void;
|
|
22
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
23
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
24
|
+
};
|
|
25
|
+
type Warning = {
|
|
26
|
+
open: boolean;
|
|
27
|
+
text?: string;
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
onConfirm?: () => void;
|
|
30
|
+
};
|
|
31
|
+
type State = {
|
|
32
|
+
warning: Warning;
|
|
33
|
+
/** The choices of each response area as the toolbar edits them; set on mount */
|
|
34
|
+
respAreaChoices?: Choices;
|
|
35
|
+
};
|
|
36
|
+
/** A response area node in the template editor */
|
|
37
|
+
type ResponseAreaNode = {
|
|
38
|
+
attrs: {
|
|
39
|
+
index: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/** The template editor; it keeps a response area's toolbar open while this holds the area's index */
|
|
43
|
+
type TemplateEditor = {
|
|
44
|
+
_holdInlineDropdownToolbarIndex?: string;
|
|
45
|
+
};
|
|
46
|
+
export declare class Main extends React.Component<MainProps, State> {
|
|
47
|
+
state: State;
|
|
48
|
+
componentDidMount(): void;
|
|
49
|
+
UNSAFE_componentWillReceiveProps(nProps: MainProps): void;
|
|
50
|
+
componentDidUpdate(): void;
|
|
51
|
+
onModelChange: (newVal: Partial<AuthorModel>) => void;
|
|
52
|
+
onPromptChanged: (prompt: string) => void;
|
|
53
|
+
onRationaleChanged: (rationale: string) => void;
|
|
54
|
+
onChoiceRationaleChanged: (index: string, choice: Choice) => void;
|
|
55
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
56
|
+
onMarkupChanged: (slateMarkup: string) => void;
|
|
57
|
+
onCheck: (confirmCallback: () => void, cancelCallback: () => void) => void;
|
|
58
|
+
validateResponseAreaClose: (node: ResponseAreaNode, pos: number, editor: TemplateEditor, closeToolbar: () => void, onCancel: () => void) => void;
|
|
59
|
+
onChange: (markup: string) => void;
|
|
60
|
+
onAddChoice: (index: string, label: string, choiceIndex: number) => void;
|
|
61
|
+
onRemoveChoice: (respIndex: string, index: number) => void;
|
|
62
|
+
onSelectChoice: (respIndex: string, selectedIndex: number) => void;
|
|
63
|
+
render(): React.JSX.Element;
|
|
64
|
+
}
|
|
65
|
+
export default Main;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { generateValidationMessage as e } from "./utils.js";
|
|
2
|
+
import t from "./inline-dropdown-toolbar.js";
|
|
3
|
+
import n from "./response-area.js";
|
|
4
|
+
import r from "react";
|
|
5
|
+
import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
|
|
6
|
+
import a from "react-dom";
|
|
7
|
+
import { cloneDeep as o, isEmpty as s, isEqual as c, isUndefined as l, max as u, reduce as d } from "@pie-element/shared-lodash";
|
|
8
|
+
import { color as f } from "@pie-lib/render-ui";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { styled as h } from "@mui/material/styles";
|
|
11
|
+
import g, { ALL_PLUGINS as ee, deleteInlineDropdownByIndex as _ } from "@pie-lib/editable-html-tip-tap";
|
|
12
|
+
import { AlertDialog as te, InputContainer as v, layout as y, settings as b } from "@pie-lib/config-ui";
|
|
13
|
+
import x from "@mui/material/Tooltip";
|
|
14
|
+
import S from "@mui/material/Typography";
|
|
15
|
+
import ne from "@mui/material/Accordion";
|
|
16
|
+
import re from "@mui/material/AccordionSummary";
|
|
17
|
+
import C from "@mui/material/AccordionDetails";
|
|
18
|
+
import w from "@mui/icons-material/ExpandMore";
|
|
19
|
+
import T from "@mui/icons-material/Info";
|
|
20
|
+
//#region src/author/main.tsx
|
|
21
|
+
var { toggle: E, Panel: D, dropdown: ie } = b, O = h(v)(({ theme: e }) => ({
|
|
22
|
+
width: "100%",
|
|
23
|
+
paddingTop: e.spacing(2),
|
|
24
|
+
marginBottom: e.spacing(2)
|
|
25
|
+
})), ae = h(v)(({ theme: e }) => ({
|
|
26
|
+
width: "100%",
|
|
27
|
+
paddingTop: e.spacing(.5),
|
|
28
|
+
marginBottom: e.spacing(2)
|
|
29
|
+
})), k = h(S)(({ theme: e }) => ({
|
|
30
|
+
fontSize: e.typography.fontSize + 2,
|
|
31
|
+
marginRight: e.spacing(1)
|
|
32
|
+
})), oe = h("span")(({ theme: e }) => ({
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
whiteSpace: "break-spaces",
|
|
36
|
+
color: f.disabled(),
|
|
37
|
+
padding: 0,
|
|
38
|
+
fontSize: e.typography.fontSize - 2,
|
|
39
|
+
lineHeight: 1
|
|
40
|
+
})), se = h("div")(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), A = h(C)({
|
|
41
|
+
display: "block",
|
|
42
|
+
paddingTop: 0,
|
|
43
|
+
paddingBottom: 0
|
|
44
|
+
}), j = h("div")(({ theme: e }) => ({
|
|
45
|
+
display: "flex",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
marginBottom: e.spacing(1)
|
|
48
|
+
})), M = h(x)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
49
|
+
fontSize: e.typography.fontSize - 2,
|
|
50
|
+
whiteSpace: "pre",
|
|
51
|
+
maxWidth: "500px"
|
|
52
|
+
} })), N = h("div")(({ theme: e }) => ({
|
|
53
|
+
fontSize: e.typography.fontSize - 2,
|
|
54
|
+
color: e.palette.error.main,
|
|
55
|
+
paddingTop: e.spacing(1)
|
|
56
|
+
})), P = (e) => {
|
|
57
|
+
let t = document.createElement("div");
|
|
58
|
+
return t.innerHTML = (e || "").trim(), t;
|
|
59
|
+
}, F = class extends r.Component {
|
|
60
|
+
state = { warning: { open: !1 } };
|
|
61
|
+
componentDidMount() {
|
|
62
|
+
let { model: { choices: e } } = this.props;
|
|
63
|
+
this.setState({ respAreaChoices: o(e) });
|
|
64
|
+
}
|
|
65
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
66
|
+
let t = {};
|
|
67
|
+
(!c(e.model.choices, this.props.model.choices) || !c(e.model.choices, this.state.respAreaChoices)) && (t.respAreaChoices = o(e.model.choices)), s(t) || this.setState(t);
|
|
68
|
+
}
|
|
69
|
+
componentDidUpdate() {
|
|
70
|
+
i(a.findDOMNode(this));
|
|
71
|
+
}
|
|
72
|
+
onModelChange = (e) => {
|
|
73
|
+
this.props.onModelChanged({
|
|
74
|
+
...this.props.model,
|
|
75
|
+
...e
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
onPromptChanged = (e) => {
|
|
79
|
+
this.onModelChange({ prompt: e });
|
|
80
|
+
};
|
|
81
|
+
onRationaleChanged = (e) => {
|
|
82
|
+
this.onModelChange({ rationale: e });
|
|
83
|
+
};
|
|
84
|
+
onChoiceRationaleChanged = (e, t) => {
|
|
85
|
+
let { model: n } = this.props, r = n.choices && n.choices[e] && n.choices[e].findIndex((e) => e.label === t.label && e.value === t.value);
|
|
86
|
+
n.choices[e] && n.choices[e].splice(r, 1, t), this.onModelChange(n);
|
|
87
|
+
};
|
|
88
|
+
onTeacherInstructionsChanged = (e) => {
|
|
89
|
+
this.onModelChange({ teacherInstructions: e });
|
|
90
|
+
};
|
|
91
|
+
onMarkupChanged = (e) => {
|
|
92
|
+
this.onModelChange({ slateMarkup: e });
|
|
93
|
+
};
|
|
94
|
+
onCheck = (e, t) => {
|
|
95
|
+
this.setState({ warning: {
|
|
96
|
+
open: !0,
|
|
97
|
+
text: "Response areas with under 2 options or with no correct answers will be discarded.",
|
|
98
|
+
onClose: () => {
|
|
99
|
+
this.setState({ warning: { open: !1 } }, t);
|
|
100
|
+
},
|
|
101
|
+
onConfirm: () => {
|
|
102
|
+
this.setState({ warning: { open: !1 } }, e);
|
|
103
|
+
}
|
|
104
|
+
} });
|
|
105
|
+
};
|
|
106
|
+
validateResponseAreaClose = (e, t, n, r, i) => {
|
|
107
|
+
let a = this.state.respAreaChoices, o = e.attrs.index, s = a[o] || [];
|
|
108
|
+
if (!(s.length < 2 || !s.find((e) => e.correct))) {
|
|
109
|
+
r();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
n._holdInlineDropdownToolbarIndex = o, this.onCheck(() => {
|
|
113
|
+
delete n._holdInlineDropdownToolbarIndex, _(n, o, t), r();
|
|
114
|
+
}, i);
|
|
115
|
+
};
|
|
116
|
+
onChange = (e) => {
|
|
117
|
+
let t = this.state.respAreaChoices, n = P(e), r = n.querySelectorAll("[data-type=\"inline_dropdown\"]"), i = {};
|
|
118
|
+
r.forEach((e) => {
|
|
119
|
+
i[e.dataset.index] = e.dataset.value || "";
|
|
120
|
+
});
|
|
121
|
+
let a = d(t, (e, n, r) => (l(i[r]) || (e[r] = t[r]), e), {}), s = {};
|
|
122
|
+
r.forEach((e, t) => {
|
|
123
|
+
let n = a[e.dataset.index];
|
|
124
|
+
n && (s[t] = n), e.dataset.index = `${t}`;
|
|
125
|
+
}), this.onModelChange({
|
|
126
|
+
choices: o(s),
|
|
127
|
+
slateMarkup: n.innerHTML
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
onAddChoice = (e, t, n) => {
|
|
131
|
+
let r = this.state.respAreaChoices, { maxResponseAreaChoices: i } = this.props.configuration, a = (e) => this.setState({ warning: {
|
|
132
|
+
open: !0,
|
|
133
|
+
text: e,
|
|
134
|
+
onClose: void 0,
|
|
135
|
+
onConfirm: () => {
|
|
136
|
+
this.setState({ warning: { open: !1 } });
|
|
137
|
+
}
|
|
138
|
+
} });
|
|
139
|
+
if (r[e] && r[e].length >= i) {
|
|
140
|
+
a(`There are only ${i} answers allowed per choice.`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (r[e] || (r[e] = []), (r[e] || []).find((e, r) => e.label === t && r !== n)) {
|
|
144
|
+
a("Duplicate answers are not allowed.");
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (n >= 0 && r[e]?.[n]) r[e][n].label = t;
|
|
148
|
+
else {
|
|
149
|
+
let n = r[e] && u(r[e].map((e) => parseInt(e.value)).filter((e) => !isNaN(e))) || 0;
|
|
150
|
+
r[e].push({
|
|
151
|
+
label: t,
|
|
152
|
+
value: `${n + 1}`,
|
|
153
|
+
correct: !1
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
this.onModelChange({ choices: o(r) });
|
|
157
|
+
};
|
|
158
|
+
onRemoveChoice = (e, t) => {
|
|
159
|
+
let n = this.state.respAreaChoices;
|
|
160
|
+
n[e].splice(t, 1), this.onModelChange({ choices: o(n) });
|
|
161
|
+
};
|
|
162
|
+
onSelectChoice = (e, t) => {
|
|
163
|
+
let n = this.state.respAreaChoices;
|
|
164
|
+
n[e] = n[e].map((e, n) => ({
|
|
165
|
+
...e,
|
|
166
|
+
correct: n === t
|
|
167
|
+
})), this.onModelChange({ choices: o(n) });
|
|
168
|
+
};
|
|
169
|
+
render() {
|
|
170
|
+
let { warning: i } = this.state, { model: a, configuration: o, onConfigurationChanged: s, imageSupport: c, uploadSoundSupport: l } = this.props, { baseInputConfiguration: u = {}, choiceRationale: d = {}, contentDimensions: f = {}, lockChoiceOrder: h = {}, maxResponseAreas: _, maxImageWidth: v = {}, maxImageHeight: b = {}, partialScoring: x = {}, prompt: S = {}, rationale: C = {}, settingsPanelDisabled: P, spellCheck: F = {}, teacherInstructions: I = {}, template: ce = {}, withRubric: L = {}, mathMlOptions: R = {}, language: z = {}, languageChoices: B = {}, responseAreaInputConfiguration: V = {} } = o || {}, { choiceRationaleEnabled: H, choices: U, errors: W, promptEnabled: le, rationaleEnabled: ue, spellCheckEnabled: G, teacherInstructionsEnabled: de, toolbarEditorPosition: fe } = a || {}, { prompt: K, rationale: q, responseAreasError: J, responseAreaChoicesError: pe, teacherInstructions: Y } = W || {}, X = v && v.prompt, Z = b && b.prompt, me = () => (Object.keys(U) || []).map((e, t) => /* @__PURE__ */ p(se, { children: /* @__PURE__ */ m(ne, {
|
|
171
|
+
slotProps: { transition: { timeout: {
|
|
172
|
+
enter: 225,
|
|
173
|
+
exit: 195
|
|
174
|
+
} } },
|
|
175
|
+
children: [/* @__PURE__ */ p(re, {
|
|
176
|
+
expandIcon: /* @__PURE__ */ p(w, {}),
|
|
177
|
+
children: /* @__PURE__ */ p(k, {
|
|
178
|
+
component: "div",
|
|
179
|
+
children: `Rationale for response area #${t + 1}`
|
|
180
|
+
})
|
|
181
|
+
}), /* @__PURE__ */ p(A, { children: (U[e] || []).map((t) => /* @__PURE__ */ m(r.Fragment, { children: [/* @__PURE__ */ p(oe, { dangerouslySetInnerHTML: { __html: `${C.label} for ${t.label} (${t.correct ? "correct" : "incorrect"})` } }), /* @__PURE__ */ p(ae, { children: /* @__PURE__ */ p(g, {
|
|
182
|
+
markup: t.rationale || "",
|
|
183
|
+
spellCheck: G,
|
|
184
|
+
pluginProps: $(C?.inputConfiguration),
|
|
185
|
+
onChange: (n) => this.onChoiceRationaleChanged(e, {
|
|
186
|
+
...t,
|
|
187
|
+
rationale: n
|
|
188
|
+
}),
|
|
189
|
+
imageSupport: c,
|
|
190
|
+
maxImageWidth: v && v.rationale || X,
|
|
191
|
+
maxImageHeight: b && b.rationale || Z,
|
|
192
|
+
uploadSoundSupport: l,
|
|
193
|
+
mathMlOptions: R
|
|
194
|
+
}) })] }, t.label)) })]
|
|
195
|
+
}) }, e)), Q = { position: fe === "top" ? "top" : "bottom" }, he = e(o), ge = {
|
|
196
|
+
partialScoring: x.settings && E(x.label),
|
|
197
|
+
lockChoiceOrder: h.settings && E(h.label),
|
|
198
|
+
"language.enabled": z.settings && E(z.label, !0),
|
|
199
|
+
language: z.settings && z.enabled && ie(B.label, B.options)
|
|
200
|
+
}, _e = {
|
|
201
|
+
teacherInstructionsEnabled: I.settings && E(I.label),
|
|
202
|
+
rationaleEnabled: C.settings && E(C.label),
|
|
203
|
+
choiceRationaleEnabled: d.settings && E(d.label),
|
|
204
|
+
promptEnabled: S.settings && E(S.label),
|
|
205
|
+
spellCheckEnabled: F.settings && E(F.label),
|
|
206
|
+
rubricEnabled: L?.settings && E(L?.label)
|
|
207
|
+
}, $ = (e = {}) => ({
|
|
208
|
+
...u,
|
|
209
|
+
...e
|
|
210
|
+
});
|
|
211
|
+
return /* @__PURE__ */ m(y.ConfigLayout, {
|
|
212
|
+
extraCSSRules: {
|
|
213
|
+
names: ["red", "blue"],
|
|
214
|
+
rules: "\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n "
|
|
215
|
+
},
|
|
216
|
+
dimensions: f,
|
|
217
|
+
hideSettings: P,
|
|
218
|
+
settings: /* @__PURE__ */ p(D, {
|
|
219
|
+
model: a,
|
|
220
|
+
configuration: o,
|
|
221
|
+
onChangeModel: (e) => this.onModelChange(e),
|
|
222
|
+
onChangeConfiguration: (e) => s(e, !0),
|
|
223
|
+
groups: {
|
|
224
|
+
Settings: ge,
|
|
225
|
+
Properties: _e
|
|
226
|
+
}
|
|
227
|
+
}),
|
|
228
|
+
children: [
|
|
229
|
+
de && /* @__PURE__ */ m(O, {
|
|
230
|
+
label: I.label,
|
|
231
|
+
children: [/* @__PURE__ */ p(g, {
|
|
232
|
+
markup: a.teacherInstructions || "",
|
|
233
|
+
onChange: this.onTeacherInstructionsChanged,
|
|
234
|
+
imageSupport: c,
|
|
235
|
+
nonEmpty: !1,
|
|
236
|
+
error: Y,
|
|
237
|
+
toolbarOpts: Q,
|
|
238
|
+
pluginProps: $(I?.inputConfiguration),
|
|
239
|
+
spellCheck: G,
|
|
240
|
+
maxImageWidth: v && v.teacherInstructions || X,
|
|
241
|
+
maxImageHeight: b && b.teacherInstructions || Z,
|
|
242
|
+
uploadSoundSupport: l,
|
|
243
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
244
|
+
mathMlOptions: R
|
|
245
|
+
}), Y && /* @__PURE__ */ p(N, { children: Y })]
|
|
246
|
+
}),
|
|
247
|
+
le && /* @__PURE__ */ m(O, {
|
|
248
|
+
label: S.label,
|
|
249
|
+
children: [/* @__PURE__ */ p(g, {
|
|
250
|
+
markup: a.prompt,
|
|
251
|
+
onChange: this.onPromptChanged,
|
|
252
|
+
imageSupport: c,
|
|
253
|
+
nonEmpty: !1,
|
|
254
|
+
disableUnderline: !0,
|
|
255
|
+
error: K,
|
|
256
|
+
toolbarOpts: Q,
|
|
257
|
+
pluginProps: $(S?.inputConfiguration),
|
|
258
|
+
spellCheck: G,
|
|
259
|
+
maxImageWidth: X,
|
|
260
|
+
maxImageHeight: Z,
|
|
261
|
+
uploadSoundSupport: l,
|
|
262
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
263
|
+
mathMlOptions: R
|
|
264
|
+
}), K && /* @__PURE__ */ p(N, { children: K })]
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ m(j, { children: [/* @__PURE__ */ p(k, {
|
|
267
|
+
component: "div",
|
|
268
|
+
children: "Define Template, Choices, and Correct Responses"
|
|
269
|
+
}), /* @__PURE__ */ p(M, {
|
|
270
|
+
disableFocusListener: !0,
|
|
271
|
+
disableTouchListener: !0,
|
|
272
|
+
placement: "right",
|
|
273
|
+
title: he,
|
|
274
|
+
children: /* @__PURE__ */ p(T, {
|
|
275
|
+
fontSize: "small",
|
|
276
|
+
color: "primary"
|
|
277
|
+
})
|
|
278
|
+
})] }),
|
|
279
|
+
/* @__PURE__ */ p(n, {
|
|
280
|
+
responseAreasError: J,
|
|
281
|
+
responseAreaChoicesError: pe,
|
|
282
|
+
editableHtmlProps: {
|
|
283
|
+
pluginProps: $(ce?.inputConfiguration),
|
|
284
|
+
activePlugins: ee,
|
|
285
|
+
toolbarOpts: { position: "top" },
|
|
286
|
+
extraCSSRules: {
|
|
287
|
+
names: ["red", "blue"],
|
|
288
|
+
rules: "\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n "
|
|
289
|
+
},
|
|
290
|
+
responseAreaProps: {
|
|
291
|
+
type: "inline-dropdown",
|
|
292
|
+
options: { duplicates: !0 },
|
|
293
|
+
maxResponseAreas: _,
|
|
294
|
+
onToolbarCloseRequest: ([e, t], n, r, i) => {
|
|
295
|
+
this.validateResponseAreaClose(e, t, n, r, i);
|
|
296
|
+
},
|
|
297
|
+
respAreaToolbar: (e, n, r) => {
|
|
298
|
+
let [i, a] = e, o = this.state.respAreaChoices;
|
|
299
|
+
return (e) => /* @__PURE__ */ p(t, {
|
|
300
|
+
...e,
|
|
301
|
+
onAddChoice: this.onAddChoice,
|
|
302
|
+
onRemoveChoice: (e) => this.onRemoveChoice(i.attrs.index, e),
|
|
303
|
+
onSelectChoice: (e) => this.onSelectChoice(i.attrs.index, e),
|
|
304
|
+
node: i,
|
|
305
|
+
pos: a,
|
|
306
|
+
editor: n,
|
|
307
|
+
onToolbarDone: r,
|
|
308
|
+
choices: o[i.attrs.index],
|
|
309
|
+
spellCheck: G,
|
|
310
|
+
uploadSoundSupport: l,
|
|
311
|
+
mathMlOptions: R,
|
|
312
|
+
baseInputConfiguration: u,
|
|
313
|
+
responseAreaInputConfiguration: V
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
spellCheck: G,
|
|
318
|
+
markup: a.slateMarkup || "",
|
|
319
|
+
onChange: this.onChange,
|
|
320
|
+
imageSupport: c,
|
|
321
|
+
disableImageAlignmentButtons: !0,
|
|
322
|
+
disabled: !1,
|
|
323
|
+
highlightShape: !1,
|
|
324
|
+
error: J,
|
|
325
|
+
uploadSoundSupport: l,
|
|
326
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
327
|
+
mathMlOptions: R
|
|
328
|
+
}
|
|
329
|
+
}),
|
|
330
|
+
H && me(),
|
|
331
|
+
ue && /* @__PURE__ */ m(O, {
|
|
332
|
+
label: C.label,
|
|
333
|
+
children: [/* @__PURE__ */ p(g, {
|
|
334
|
+
markup: a.rationale || "",
|
|
335
|
+
onChange: this.onRationaleChanged,
|
|
336
|
+
imageSupport: c,
|
|
337
|
+
error: q,
|
|
338
|
+
toolbarOpts: Q,
|
|
339
|
+
pluginProps: $(C?.inputConfiguration),
|
|
340
|
+
spellCheck: G,
|
|
341
|
+
maxImageWidth: v && v.rationale || X,
|
|
342
|
+
maxImageHeight: b && b.rationale || Z,
|
|
343
|
+
uploadSoundSupport: l,
|
|
344
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
345
|
+
mathMlOptions: R
|
|
346
|
+
}), q && /* @__PURE__ */ p(N, { children: q })]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ p(te, {
|
|
349
|
+
open: i.open,
|
|
350
|
+
title: "Warning",
|
|
351
|
+
text: i.text,
|
|
352
|
+
onClose: i.onClose,
|
|
353
|
+
onConfirm: i.onConfirm,
|
|
354
|
+
disableAutoFocus: !0,
|
|
355
|
+
disableEnforceFocus: !0,
|
|
356
|
+
disableRestoreFocus: !0
|
|
357
|
+
})
|
|
358
|
+
]
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
//#endregion
|
|
363
|
+
export { F as Main, F as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const removeUnwantedCharacters: (markup: any) => any;
|
|
2
|
+
export declare const createElementFromHTML: (htmlString: any) => HTMLDivElement;
|
|
3
|
+
export declare const processMarkup: (markup: any) => string;
|
|
4
|
+
export declare const createSlateMarkup: (markup: any, choices: any) => any;
|