markdown-flow-ui 0.2.22 → 0.2.24-dev.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/dist/_virtual/index.es3.js +4 -5
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +5 -4
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.d.ts +9 -1
- package/dist/components/ContentRender/MarkdownFlowInput.es.js +24 -23
- package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
- package/dist/components/ContentRender/index.d.ts +1 -1
- package/dist/components/Slide/Player.cjs +1 -1
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.d.ts +3 -1
- package/dist/components/Slide/Player.es.js +457 -488
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.es.js +589 -580
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/slideI18n.cjs.map +1 -1
- package/dist/components/Slide/slideI18n.d.ts +1 -0
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/components/Slide/utils/interactionPlayback.cjs +1 -1
- package/dist/components/Slide/utils/interactionPlayback.cjs.map +1 -1
- package/dist/components/Slide/utils/interactionPlayback.d.ts +2 -1
- package/dist/components/Slide/utils/interactionPlayback.es.js +8 -7
- package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
- package/dist/components/Slide/utils/playerCustomActions.cjs +1 -1
- package/dist/components/Slide/utils/playerCustomActions.cjs.map +1 -1
- package/dist/components/Slide/utils/playerCustomActions.d.ts +1 -1
- package/dist/components/Slide/utils/playerCustomActions.es.js +18 -14
- package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +0 -2
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
- package/dist/components/ui/inputGroup/input-group.cjs.map +1 -1
- package/dist/components/ui/inputGroup/input-group.d.ts +2 -21
- package/dist/components/ui/inputGroup/input-group.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.map +1 -1
- package/dist/components/ui/inputGroup/textarea.d.ts +3 -21
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js.map +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +1 -1
- package/dist/renderer.d.ts +2 -2
- package/package.json +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs +0 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +0 -29
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideI18n.cjs","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"slideI18n.cjs","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n /** @deprecated The player no longer renders a manual interaction action. */\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":"8JAqDaA,EACXC,EAAAA,QAGAD,EAAmB,OAAO,EAAE,YAG5BA,EAAmB,OAAO,EAAE,iBAEvB,MAAME,EAGTF,EAAmB,OAAO,EAAE,cAEnBG,EAAuBC,GAClCJ,EAAmBK,EAAAA,4BAA4BD,CAAM,CAAC,EAE3CE,EACXF,GAC2BD,EAAoBC,CAAM,EAAE"}
|
|
@@ -6,6 +6,7 @@ export interface SlidePlayerLocaleTexts {
|
|
|
6
6
|
moreOptionsAriaLabel: string;
|
|
7
7
|
nextLabel: string;
|
|
8
8
|
nextSubtitleLabel: string;
|
|
9
|
+
/** @deprecated The player no longer renders a manual interaction action. */
|
|
9
10
|
notesLabel: string;
|
|
10
11
|
pauseAutoplayLabel: string;
|
|
11
12
|
pauseLabel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideI18n.es.js","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"slideI18n.es.js","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n /** @deprecated The player no longer renders a manual interaction action. */\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":";;AAqDO,MAAMA,IACXC;AAGAD,EAAmB,OAAO,EAAE;AAG5BA,EAAmB,OAAO,EAAE;AAEvB,MAAME,IAGTF,EAAmB,OAAO,EAAE,eAEnBG,IAAsB,CAACC,MAClCJ,EAAmBK,EAA4BD,CAAM,CAAC,GAE3CE,IAAsB,CACjCF,MAC2BD,EAAoBC,CAAM,EAAE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=({hasInteraction:r,shouldBlockPlaybackForInteraction:e,shouldOpenInteractionOverlayAfterAudio:t,hasPlaybackContextChanged:a,hasResolvedCurrentInteraction:l,currentStepHasSpeakableElement:i,isPlayerCustomActionActive:u})=>!r||u?!1:e||t||a?!0:l?!i:!1,o=({hasActiveInteraction:r,isInteractionOverlayOpen:e})=>!(!r||!e),n=(r,e,t)=>Math.min(Math.max(r,e),t),s=(r,e)=>({x:n(r.x,e.minX,e.maxX),y:n(r.y,e.minY,e.maxY)});exports.clampInteractionOverlayDragOffset=s;exports.shouldPresentInteractionOverlay=c;exports.shouldRenderInteractionOverlay=o;
|
|
2
2
|
//# sourceMappingURL=interactionPlayback.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionPlayback.cjs","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n //
|
|
1
|
+
{"version":3,"file":"interactionPlayback.cjs","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n isPlayerCustomActionActive: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n isPlayerCustomActionActive,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction || isPlayerCustomActionActive) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into the\n // interaction step so history and manual prev/next navigation surface it.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n\nexport interface ShouldRenderInteractionOverlayParams {\n hasActiveInteraction: boolean;\n isInteractionOverlayOpen: boolean;\n}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n return true;\n};\n\nexport interface InteractionOverlayDragOffset {\n x: number;\n y: number;\n}\n\nexport interface InteractionOverlayDragBounds {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n}\n\nconst clampNumber = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max);\n\nexport const clampInteractionOverlayDragOffset = (\n offset: InteractionOverlayDragOffset,\n bounds: InteractionOverlayDragBounds\n): InteractionOverlayDragOffset => ({\n x: clampNumber(offset.x, bounds.minX, bounds.maxX),\n y: clampNumber(offset.y, bounds.minY, bounds.maxY),\n});\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","isPlayerCustomActionActive","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","clampNumber","value","min","max","clampInteractionOverlayDragOffset","offset","bounds"],"mappings":"gFAUO,MAAMA,EAAkC,CAAC,CAC9C,eAAAC,EACA,kCAAAC,EACA,uCAAAC,EACA,0BAAAC,EACA,8BAAAC,EACA,+BAAAC,EACA,2BAAAC,CACF,IACM,CAACN,GAAkBM,EACd,GAGLL,GAIAC,GAMAC,EACK,GAGJC,EAME,CAACC,EALC,GAaEE,EAAiC,CAAC,CAC7C,qBAAAC,EACA,yBAAAC,CACF,IACM,GAACD,GAAwB,CAACC,GAmB1BC,EAAc,CAACC,EAAeC,EAAaC,IAC/C,KAAK,IAAI,KAAK,IAAIF,EAAOC,CAAG,EAAGC,CAAG,EAEvBC,EAAoC,CAC/CC,EACAC,KACkC,CAClC,EAAGN,EAAYK,EAAO,EAAGC,EAAO,KAAMA,EAAO,IAAI,EACjD,EAAGN,EAAYK,EAAO,EAAGC,EAAO,KAAMA,EAAO,IAAI,CACnD"}
|
|
@@ -5,8 +5,9 @@ interface ShouldPresentInteractionOverlayParams {
|
|
|
5
5
|
hasPlaybackContextChanged: boolean;
|
|
6
6
|
hasResolvedCurrentInteraction: boolean;
|
|
7
7
|
currentStepHasSpeakableElement: boolean;
|
|
8
|
+
isPlayerCustomActionActive: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const shouldPresentInteractionOverlay: ({ hasInteraction, shouldBlockPlaybackForInteraction, shouldOpenInteractionOverlayAfterAudio, hasPlaybackContextChanged, hasResolvedCurrentInteraction, currentStepHasSpeakableElement, }: ShouldPresentInteractionOverlayParams) => boolean;
|
|
10
|
+
export declare const shouldPresentInteractionOverlay: ({ hasInteraction, shouldBlockPlaybackForInteraction, shouldOpenInteractionOverlayAfterAudio, hasPlaybackContextChanged, hasResolvedCurrentInteraction, currentStepHasSpeakableElement, isPlayerCustomActionActive, }: ShouldPresentInteractionOverlayParams) => boolean;
|
|
10
11
|
export interface ShouldRenderInteractionOverlayParams {
|
|
11
12
|
hasActiveInteraction: boolean;
|
|
12
13
|
isInteractionOverlayOpen: boolean;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = ({
|
|
2
2
|
hasInteraction: e,
|
|
3
3
|
shouldBlockPlaybackForInteraction: r,
|
|
4
4
|
shouldOpenInteractionOverlayAfterAudio: t,
|
|
5
5
|
hasPlaybackContextChanged: a,
|
|
6
6
|
hasResolvedCurrentInteraction: i,
|
|
7
|
-
currentStepHasSpeakableElement: u
|
|
8
|
-
|
|
7
|
+
currentStepHasSpeakableElement: u,
|
|
8
|
+
isPlayerCustomActionActive: l
|
|
9
|
+
}) => !e || l ? !1 : r || t || a ? !0 : i ? !u : !1, f = ({
|
|
9
10
|
hasActiveInteraction: e,
|
|
10
11
|
isInteractionOverlayOpen: r
|
|
11
|
-
}) => !(!e || !r), n = (e, r, t) => Math.min(Math.max(e, r), t),
|
|
12
|
+
}) => !(!e || !r), n = (e, r, t) => Math.min(Math.max(e, r), t), m = (e, r) => ({
|
|
12
13
|
x: n(e.x, r.minX, r.maxX),
|
|
13
14
|
y: n(e.y, r.minY, r.maxY)
|
|
14
15
|
});
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
m as clampInteractionOverlayDragOffset,
|
|
18
|
+
c as shouldPresentInteractionOverlay,
|
|
19
|
+
f as shouldRenderInteractionOverlay
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=interactionPlayback.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionPlayback.es.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n //
|
|
1
|
+
{"version":3,"file":"interactionPlayback.es.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n isPlayerCustomActionActive: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n isPlayerCustomActionActive,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction || isPlayerCustomActionActive) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into the\n // interaction step so history and manual prev/next navigation surface it.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n\nexport interface ShouldRenderInteractionOverlayParams {\n hasActiveInteraction: boolean;\n isInteractionOverlayOpen: boolean;\n}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n return true;\n};\n\nexport interface InteractionOverlayDragOffset {\n x: number;\n y: number;\n}\n\nexport interface InteractionOverlayDragBounds {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n}\n\nconst clampNumber = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max);\n\nexport const clampInteractionOverlayDragOffset = (\n offset: InteractionOverlayDragOffset,\n bounds: InteractionOverlayDragBounds\n): InteractionOverlayDragOffset => ({\n x: clampNumber(offset.x, bounds.minX, bounds.maxX),\n y: clampNumber(offset.y, bounds.minY, bounds.maxY),\n});\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","isPlayerCustomActionActive","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","clampNumber","value","min","max","clampInteractionOverlayDragOffset","offset","bounds"],"mappings":"AAUO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,gBAAAC;AAAA,EACA,mCAAAC;AAAA,EACA,wCAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,+BAAAC;AAAA,EACA,gCAAAC;AAAA,EACA,4BAAAC;AACF,MACM,CAACN,KAAkBM,IACd,KAGLL,KAIAC,KAMAC,IACK,KAGJC,IAME,CAACC,IALC,IAaEE,IAAiC,CAAC;AAAA,EAC7C,sBAAAC;AAAA,EACA,0BAAAC;AACF,MACM,GAACD,KAAwB,CAACC,IAmB1BC,IAAc,CAACC,GAAeC,GAAaC,MAC/C,KAAK,IAAI,KAAK,IAAIF,GAAOC,CAAG,GAAGC,CAAG,GAEvBC,IAAoC,CAC/CC,GACAC,OACkC;AAAA,EAClC,GAAGN,EAAYK,EAAO,GAAGC,EAAO,MAAMA,EAAO,IAAI;AAAA,EACjD,GAAGN,EAAYK,EAAO,GAAGC,EAAO,MAAMA,EAAO,IAAI;AACnD;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),l=()=>{},y={currentElement:void 0,currentIndex:-1,currentStepElement:void 0,isActive:!1,setActive:l,toggleActive:l},C=(e,t=y)=>typeof e=="function"?e(t):e,s=e=>n.Children.toArray(e).flatMap(t=>n.isValidElement(t)&&t.type===n.Fragment?s(t.props.children):t),d=({currentAudioIndex:e,currentAudioSequenceIndexes:t,audioList:o,currentStepElement:i,currentInteractionElement:u})=>{const a=e>=0?o[e]?.element:void 0,r=t[0],m=typeof r=="number"?o[r]?.element:void 0;return a??m??u??i},c=(e,t)=>s(C(e,t)),A=(e,t)=>c(e,t).length;exports.getPlayerCustomActionCount=A;exports.resolvePlayerCustomActionElement=d;exports.toPlayerCustomActionList=c;
|
|
2
2
|
//# sourceMappingURL=playerCustomActions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCustomActions.cjs","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n)
|
|
1
|
+
{"version":3,"file":"playerCustomActions.cjs","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\nconst toRenderablePlayerCustomActionList = (\n customActions: React.ReactNode\n): React.ReactNode[] =>\n React.Children.toArray(customActions).flatMap((customAction) => {\n if (\n React.isValidElement(customAction) &&\n customAction.type === React.Fragment\n ) {\n return toRenderablePlayerCustomActionList(\n (customAction.props as { children?: React.ReactNode }).children\n );\n }\n\n return customAction;\n });\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) =>\n toRenderablePlayerCustomActionList(\n resolvePlayerCustomActions(customActions, context)\n );\n\nexport const getPlayerCustomActionCount = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => toPlayerCustomActionList(customActions, context).length;\n"],"names":["noop","DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT","resolvePlayerCustomActions","customActions","context","toRenderablePlayerCustomActionList","React","customAction","resolvePlayerCustomActionElement","currentAudioIndex","currentAudioSequenceIndexes","audioList","currentStepElement","currentInteractionElement","currentAudioElement","currentSequenceAudioIndex","currentSequenceAudioElement","toPlayerCustomActionList","getPlayerCustomActionCount"],"mappings":"yGAQMA,EAAO,IAAM,CAAC,EAEdC,EAAuE,CAC3E,eAAgB,OAChB,aAAc,GACd,mBAAoB,OACpB,SAAU,GACV,UAAWD,EACX,aAAcA,CAChB,EAEME,EAA6B,CACjCC,EACAC,EAA0CH,IAE1C,OAAOE,GAAkB,WAAaA,EAAcC,CAAO,EAAID,EAE3DE,EACJF,GAEAG,EAAM,SAAS,QAAQH,CAAa,EAAE,QAASI,GAE3CD,EAAM,eAAeC,CAAY,GACjCA,EAAa,OAASD,EAAM,SAErBD,EACJE,EAAa,MAAyC,QAAA,EAIpDA,CACR,EAUUC,EAAmC,CAAC,CAC/C,kBAAAC,EACA,4BAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,0BAAAC,CACF,IAA8C,CAC5C,MAAMC,EACJL,GAAqB,EAAIE,EAAUF,CAAiB,GAAG,QAAU,OAC7DM,EAA4BL,EAA4B,CAAC,EACzDM,EACJ,OAAOD,GAA8B,SACjCJ,EAAUI,CAAyB,GAAG,QACtC,OAEN,OACED,GACAE,GACAH,GACAD,CAEJ,EAEaK,EAA2B,CACtCd,EACAC,IAEAC,EACEH,EAA2BC,EAAeC,CAAO,CACnD,EAEWc,EAA6B,CACxCf,EACAC,IACGa,EAAyBd,EAAeC,CAAO,EAAE"}
|
|
@@ -9,6 +9,6 @@ type ResolvePlayerCustomActionElementParams = {
|
|
|
9
9
|
currentInteractionElement?: Element;
|
|
10
10
|
};
|
|
11
11
|
export declare const resolvePlayerCustomActionElement: ({ currentAudioIndex, currentAudioSequenceIndexes, audioList, currentStepElement, currentInteractionElement, }: ResolvePlayerCustomActionElementParams) => Element | undefined;
|
|
12
|
-
export declare const toPlayerCustomActionList: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) =>
|
|
12
|
+
export declare const toPlayerCustomActionList: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) => React.ReactNode[];
|
|
13
13
|
export declare const getPlayerCustomActionCount: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) => number;
|
|
14
14
|
export {};
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import n from "react";
|
|
2
|
+
const l = () => {
|
|
3
3
|
}, m = {
|
|
4
4
|
currentElement: void 0,
|
|
5
5
|
currentIndex: -1,
|
|
6
6
|
currentStepElement: void 0,
|
|
7
7
|
isActive: !1,
|
|
8
|
-
setActive:
|
|
9
|
-
toggleActive:
|
|
10
|
-
},
|
|
8
|
+
setActive: l,
|
|
9
|
+
toggleActive: l
|
|
10
|
+
}, d = (e, t = m) => typeof e == "function" ? e(t) : e, c = (e) => n.Children.toArray(e).flatMap((t) => n.isValidElement(t) && t.type === n.Fragment ? c(
|
|
11
|
+
t.props.children
|
|
12
|
+
) : t), v = ({
|
|
11
13
|
currentAudioIndex: e,
|
|
12
14
|
currentAudioSequenceIndexes: t,
|
|
13
|
-
audioList:
|
|
14
|
-
currentStepElement:
|
|
15
|
-
currentInteractionElement:
|
|
15
|
+
audioList: r,
|
|
16
|
+
currentStepElement: i,
|
|
17
|
+
currentInteractionElement: s
|
|
16
18
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
},
|
|
19
|
+
const u = e >= 0 ? r[e]?.element : void 0, o = t[0], a = typeof o == "number" ? r[o]?.element : void 0;
|
|
20
|
+
return u ?? a ?? s ?? i;
|
|
21
|
+
}, p = (e, t) => c(
|
|
22
|
+
d(e, t)
|
|
23
|
+
), y = (e, t) => p(e, t).length;
|
|
20
24
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
y as getPlayerCustomActionCount,
|
|
26
|
+
v as resolvePlayerCustomActionElement,
|
|
27
|
+
p as toPlayerCustomActionList
|
|
24
28
|
};
|
|
25
29
|
//# sourceMappingURL=playerCustomActions.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCustomActions.es.js","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n)
|
|
1
|
+
{"version":3,"file":"playerCustomActions.es.js","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\nconst toRenderablePlayerCustomActionList = (\n customActions: React.ReactNode\n): React.ReactNode[] =>\n React.Children.toArray(customActions).flatMap((customAction) => {\n if (\n React.isValidElement(customAction) &&\n customAction.type === React.Fragment\n ) {\n return toRenderablePlayerCustomActionList(\n (customAction.props as { children?: React.ReactNode }).children\n );\n }\n\n return customAction;\n });\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) =>\n toRenderablePlayerCustomActionList(\n resolvePlayerCustomActions(customActions, context)\n );\n\nexport const getPlayerCustomActionCount = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => toPlayerCustomActionList(customActions, context).length;\n"],"names":["noop","DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT","resolvePlayerCustomActions","customActions","context","toRenderablePlayerCustomActionList","React","customAction","resolvePlayerCustomActionElement","currentAudioIndex","currentAudioSequenceIndexes","audioList","currentStepElement","currentInteractionElement","currentAudioElement","currentSequenceAudioIndex","currentSequenceAudioElement","toPlayerCustomActionList","getPlayerCustomActionCount"],"mappings":";AAQA,MAAMA,IAAO,MAAM;AAAC,GAEdC,IAAuE;AAAA,EAC3E,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,WAAWD;AAAA,EACX,cAAcA;AAChB,GAEME,IAA6B,CACjCC,GACAC,IAA0CH,MAE1C,OAAOE,KAAkB,aAAaA,EAAcC,CAAO,IAAID,GAE3DE,IAAqC,CACzCF,MAEAG,EAAM,SAAS,QAAQH,CAAa,EAAE,QAAQ,CAACI,MAE3CD,EAAM,eAAeC,CAAY,KACjCA,EAAa,SAASD,EAAM,WAErBD;AAAA,EACJE,EAAa,MAAyC;AAAA,IAIpDA,CACR,GAUUC,IAAmC,CAAC;AAAA,EAC/C,mBAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,2BAAAC;AACF,MAA8C;AAC5C,QAAMC,IACJL,KAAqB,IAAIE,EAAUF,CAAiB,GAAG,UAAU,QAC7DM,IAA4BL,EAA4B,CAAC,GACzDM,IACJ,OAAOD,KAA8B,WACjCJ,EAAUI,CAAyB,GAAG,UACtC;AAEN,SACED,KACAE,KACAH,KACAD;AAEJ,GAEaK,IAA2B,CACtCd,GACAC,MAEAC;AAAA,EACEH,EAA2BC,GAAeC,CAAO;AACnD,GAEWc,IAA6B,CACxCf,GACAC,MACGa,EAAyBd,GAAeC,CAAO,EAAE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"], [role="slider"], [role="listbox"], [role="combobox"], [role="tablist"], [role="menu"], [role="tree"], [role="grid"], [data-player-keyboard-shortcuts-ignore="true"]',i="button, [role='button']",o=new Set;let a=null;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"], [role="slider"], [role="listbox"], [role="combobox"], [role="tablist"], [role="menu"], [role="tree"], [role="grid"], [data-player-keyboard-shortcuts-ignore="true"]',i="button, [role='button']",o=new Set;let a=null;const n=e=>{if(!e||typeof e!="object")return null;const t=e;return t.nodeType===3?t.parentElement??null:t},y=(e,t="ltr")=>{if(e.altKey||e.ctrlKey||e.metaKey)return null;const r=e.key.toLowerCase();if(e.shiftKey)switch(r){case"arrowleft":return"previousSubtitle";case"arrowright":return"nextSubtitle";default:return null}if(e.code==="Space"||r===" "||r==="spacebar")return"togglePlayback";switch(r){case"arrowleft":return t==="rtl"?"next":"previous";case"arrowright":return t==="rtl"?"previous":"next";case"f":return"fullscreen";case"c":return"subtitle";default:return null}},u=e=>{const t=n(e);if(!t)return!1;const r=t.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||t.isContentEditable)return!0;const l=t.getAttribute?.("contenteditable");return l!=null?l.toLowerCase()!=="false":!!t.closest?.(s)},c=e=>{const t=n(e);return t?t.tagName?.toLowerCase()==="button"?!0:!!t.closest?.(i):!1},d=(e,t)=>e.defaultPrevented||!t||u(e.target)?!0:t==="togglePlayback"&&c(e.target),b=e=>(o.add(e),(!a||!o.has(a))&&(a=e),()=>{o.delete(e),a===e&&(a=o.values().next().value??null)}),f=e=>{if(o.size===0){a=e;return}o.has(e)&&(a=e)},g=e=>a===e;exports.activatePlayerKeyboardShortcutOwner=f;exports.getPlayerKeyboardShortcutAction=y;exports.isActivePlayerKeyboardShortcutOwner=g;exports.isPlayerKeyboardShortcutEditableTarget=u;exports.isPlayerKeyboardShortcutNativeSpaceTarget=c;exports.registerPlayerKeyboardShortcutOwner=b;exports.shouldIgnorePlayerKeyboardShortcutEvent=d;
|
|
2
2
|
//# sourceMappingURL=playerKeyboardShortcuts.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerKeyboardShortcuts.cjs","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\"
|
|
1
|
+
{"version":3,"file":"playerKeyboardShortcuts.cjs","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"gFA6BA,MAAMA,EACJ,mQAEIC,EAA+B,0BAE/BC,MAAmC,IACzC,IAAIC,EAAqD,KAEzD,MAAMC,EACJC,GACkC,CAClC,GAAI,CAACA,GAAU,OAAOA,GAAW,SAC/B,OAAO,KAGT,MAAMC,EAAYD,EAElB,OAAIC,EAAU,WAAa,EACjBA,EAAU,eAAmD,KAGhEA,CACT,EAEaC,EAAkC,CAC7CC,EACAC,EAA2B,QACa,CACxC,GAAID,EAAM,QAAUA,EAAM,SAAWA,EAAM,QACzC,OAAO,KAGT,MAAME,EAAgBF,EAAM,IAAI,YAAA,EAEhC,GAAIA,EAAM,SACR,OAAQE,EAAA,CACN,IAAK,YACH,MAAO,mBACT,IAAK,aACH,MAAO,eACT,QACE,OAAO,IAAA,CAIb,GACEF,EAAM,OAAS,SACfE,IAAkB,KAClBA,IAAkB,WAElB,MAAO,iBAGT,OAAQA,EAAA,CACN,IAAK,YACH,OAAOD,IAAc,MAAQ,OAAS,WACxC,IAAK,aACH,OAAOA,IAAc,MAAQ,WAAa,OAC5C,IAAK,IACH,MAAO,aACT,IAAK,IACH,MAAO,WACT,QACE,OAAO,IAAA,CAEb,EAEaE,EACXN,GACG,CACH,MAAMC,EAAYF,EAAmBC,CAAM,EAE3C,GAAI,CAACC,EACH,MAAO,GAGT,MAAMM,EAAUN,EAAU,SAAS,YAAA,EAMnC,GAJIM,IAAY,SAAWA,IAAY,YAAcA,IAAY,UAI7DN,EAAU,kBACZ,MAAO,GAGT,MAAMO,EAAkBP,EAAU,eAAe,iBAAiB,EAElE,OAAqCO,GAAoB,KAChDA,EAAgB,gBAAkB,QAGpC,EAAQP,EAAU,UAAUN,CAAiB,CACtD,EAEac,EACXT,GACG,CACH,MAAMC,EAAYF,EAAmBC,CAAM,EAE3C,OAAKC,EAIWA,EAAU,SAAS,YAAA,IAEnB,SACP,GAGF,EAAQA,EAAU,UAAUL,CAA4B,EATtD,EAUX,EAEac,EAA0C,CACrDP,EACAQ,IAEIR,EAAM,kBAAoB,CAACQ,GAI3BL,EAAuCH,EAAM,MAAM,EAC9C,GAIPQ,IAAW,kBACXF,EAA0CN,EAAM,MAAM,EAI7CS,EAAuCC,IAClDhB,EAA6B,IAAIgB,CAAO,GAGtC,CAACf,GACD,CAACD,EAA6B,IAAIC,CAAmC,KAErEA,EAAsCe,GAGjC,IAAM,CACXhB,EAA6B,OAAOgB,CAAO,EAEvCf,IAAwCe,IAI5Cf,EACED,EAA6B,OAAA,EAAS,KAAA,EAAO,OAAS,KAC1D,GAGWiB,EAAuCD,GAAoB,CACtE,GAAIhB,EAA6B,OAAS,EAAG,CAC3CC,EAAsCe,EACtC,MACF,CAEIhB,EAA6B,IAAIgB,CAAO,IAC1Cf,EAAsCe,EAE1C,EAEaE,EAAuCF,GAClDf,IAAwCe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type PlayerKeyboardShortcutAction = "togglePlayback" | "previous" | "next" | "previousSubtitle" | "nextSubtitle" | "fullscreen" | "subtitle"
|
|
1
|
+
export type PlayerKeyboardShortcutAction = "togglePlayback" | "previous" | "next" | "previousSubtitle" | "nextSubtitle" | "fullscreen" | "subtitle";
|
|
2
2
|
export interface PlayerKeyboardShortcutEventLike {
|
|
3
3
|
altKey?: boolean;
|
|
4
4
|
code?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerKeyboardShortcuts.es.js","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\"
|
|
1
|
+
{"version":3,"file":"playerKeyboardShortcuts.es.js","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"AA6BA,MAAMA,IACJ,oQAEIC,IAA+B,2BAE/BC,wBAAmC,IAAA;AACzC,IAAIC,IAAqD;AAEzD,MAAMC,IAAqB,CACzBC,MACkC;AAClC,MAAI,CAACA,KAAU,OAAOA,KAAW;AAC/B,WAAO;AAGT,QAAMC,IAAYD;AAElB,SAAIC,EAAU,aAAa,IACjBA,EAAU,iBAAmD,OAGhEA;AACT,GAEaC,IAAkC,CAC7CC,GACAC,IAA2B,UACa;AACxC,MAAID,EAAM,UAAUA,EAAM,WAAWA,EAAM;AACzC,WAAO;AAGT,QAAME,IAAgBF,EAAM,IAAI,YAAA;AAEhC,MAAIA,EAAM;AACR,YAAQE,GAAA;AAAA,MACN,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAIb,MACEF,EAAM,SAAS,WACfE,MAAkB,OAClBA,MAAkB;AAElB,WAAO;AAGT,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAOD,MAAc,QAAQ,SAAS;AAAA,IACxC,KAAK;AACH,aAAOA,MAAc,QAAQ,aAAa;AAAA,IAC5C,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb,GAEaE,IAAyC,CACpDN,MACG;AACH,QAAMC,IAAYF,EAAmBC,CAAM;AAE3C,MAAI,CAACC;AACH,WAAO;AAGT,QAAMM,IAAUN,EAAU,SAAS,YAAA;AAMnC,MAJIM,MAAY,WAAWA,MAAY,cAAcA,MAAY,YAI7DN,EAAU;AACZ,WAAO;AAGT,QAAMO,IAAkBP,EAAU,eAAe,iBAAiB;AAElE,SAAqCO,KAAoB,OAChDA,EAAgB,kBAAkB,UAGpC,EAAQP,EAAU,UAAUN,CAAiB;AACtD,GAEac,IAA4C,CACvDT,MACG;AACH,QAAMC,IAAYF,EAAmBC,CAAM;AAE3C,SAAKC,IAIWA,EAAU,SAAS,YAAA,MAEnB,WACP,KAGF,EAAQA,EAAU,UAAUL,CAA4B,IATtD;AAUX,GAEac,IAA0C,CACrDP,GACAQ,MAEIR,EAAM,oBAAoB,CAACQ,KAI3BL,EAAuCH,EAAM,MAAM,IAC9C,KAIPQ,MAAW,oBACXF,EAA0CN,EAAM,MAAM,GAI7CS,IAAsC,CAACC,OAClDhB,EAA6B,IAAIgB,CAAO,IAGtC,CAACf,KACD,CAACD,EAA6B,IAAIC,CAAmC,OAErEA,IAAsCe,IAGjC,MAAM;AAGX,EAFAhB,EAA6B,OAAOgB,CAAO,GAEvCf,MAAwCe,MAI5Cf,IACED,EAA6B,OAAA,EAAS,KAAA,EAAO,SAAS;AAC1D,IAGWiB,IAAsC,CAACD,MAAoB;AACtE,MAAIhB,EAA6B,SAAS,GAAG;AAC3C,IAAAC,IAAsCe;AACtC;AAAA,EACF;AAEA,EAAIhB,EAA6B,IAAIgB,CAAO,MAC1Cf,IAAsCe;AAE1C,GAEaE,IAAsC,CAACF,MAClDf,MAAwCe;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.cjs","sources":["../../../../src/components/ui/inputGroup/input-group.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { TextAreaProps, TextAreaRef } from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Textarea } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <span\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"bg-white group/input-group border-input dark:bg-input/30 relative flex items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex shrink-0 gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n);\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n}\n\nconst InputGroupTextarea = React.forwardRef<TextAreaRef, TextAreaProps>(\n ({ className, ...props }, ref) => {\n return (\n <Textarea\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 max-w-none flex-1 resize-none rounded-none border-0 bg-transparent py-1.5 shadow-none dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n }\n);\nInputGroupTextarea.displayName = \"InputGroupTextarea\";\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"names":["InputGroup","className","props","jsx","cn","inputGroupButtonVariants","cva","InputGroupButton","type","variant","size","Button","InputGroupTextarea","React","ref","Textarea"],"mappings":"ukBASA,SAASA,EAAW,CAAE,UAAAC,EAAW,GAAGC,GAAsC,CACxE,OACEC,EAAAA,IAAC,OAAA,CACC,YAAU,cACV,KAAK,QACL,UAAWC,EAAAA,GACT,6JACA,qCAGA,kDACA,gDACA,iIACA,2HAGA,iLAEAH,CAAA,EAED,GAAGC,CAAA,CAAA,CAGV,CA6CA,MAAMG,EAA2BC,EAAAA,IAC/B,uDACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,0GACJ,GAAI,kDACJ,UACE,8DACF,UAAW,2BAAA,CACb,EAEF,gBAAiB,CACf,KAAM,IAAA,CACR,CAEJ,EAEA,SAASC,EAAiB,CACxB,UAAAN,EACA,KAAAO,EAAO,SACP,QAAAC,EAAU,QACV,KAAAC,EAAO,KACP,GAAGR,CACL,EACiD,CAC/C,OACEC,EAAAA,IAACQ,EAAAA,OAAA,CACC,KAAAH,EACA,YAAWE,EACX,QAAAD,EACA,UAAWL,EAAAA,GAAGC,EAAyB,CAAE,KAAAK,CAAA,CAAM,EAAGT,CAAS,EAC1D,GAAGC,CAAA,CAAA,CAGV,CA8BA,MAAMU,
|
|
1
|
+
{"version":3,"file":"input-group.cjs","sources":["../../../../src/components/ui/inputGroup/input-group.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { TextAreaProps, TextAreaRef } from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Textarea } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <span\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"bg-white group/input-group border-input dark:bg-input/30 relative flex items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex shrink-0 gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n);\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n}\n\nconst InputGroupTextarea: React.ForwardRefExoticComponent<\n React.PropsWithoutRef<TextAreaProps> & React.RefAttributes<TextAreaRef>\n> = React.forwardRef<TextAreaRef, TextAreaProps>(\n ({ className, ...props }, ref) => {\n return (\n <Textarea\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 max-w-none flex-1 resize-none rounded-none border-0 bg-transparent py-1.5 shadow-none dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n }\n);\nInputGroupTextarea.displayName = \"InputGroupTextarea\";\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"names":["InputGroup","className","props","jsx","cn","inputGroupButtonVariants","cva","InputGroupButton","type","variant","size","Button","InputGroupTextarea","React","ref","Textarea"],"mappings":"ukBASA,SAASA,EAAW,CAAE,UAAAC,EAAW,GAAGC,GAAsC,CACxE,OACEC,EAAAA,IAAC,OAAA,CACC,YAAU,cACV,KAAK,QACL,UAAWC,EAAAA,GACT,6JACA,qCAGA,kDACA,gDACA,iIACA,2HAGA,iLAEAH,CAAA,EAED,GAAGC,CAAA,CAAA,CAGV,CA6CA,MAAMG,EAA2BC,EAAAA,IAC/B,uDACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,0GACJ,GAAI,kDACJ,UACE,8DACF,UAAW,2BAAA,CACb,EAEF,gBAAiB,CACf,KAAM,IAAA,CACR,CAEJ,EAEA,SAASC,EAAiB,CACxB,UAAAN,EACA,KAAAO,EAAO,SACP,QAAAC,EAAU,QACV,KAAAC,EAAO,KACP,GAAGR,CACL,EACiD,CAC/C,OACEC,EAAAA,IAACQ,EAAAA,OAAA,CACC,KAAAH,EACA,YAAWE,EACX,QAAAD,EACA,UAAWL,EAAAA,GAAGC,EAAyB,CAAE,KAAAK,CAAA,CAAM,EAAGT,CAAS,EAC1D,GAAGC,CAAA,CAAA,CAGV,CA8BA,MAAMU,EAEFC,EAAM,WACR,CAAC,CAAE,UAAAZ,EAAW,GAAGC,CAAA,EAASY,IAEtBX,EAAAA,IAACY,EAAAA,SAAA,CACC,IAAAD,EACA,YAAU,sBACV,UAAWV,EAAAA,GACT,oHACAH,CAAA,EAED,GAAGC,CAAA,CAAA,CAIZ,EACAU,EAAmB,YAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { TextAreaRef } from 'rc-textarea';
|
|
2
|
+
import { TextAreaProps, TextAreaRef } from 'rc-textarea';
|
|
3
3
|
import { Button } from './button.js';
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -13,24 +13,5 @@ declare const inputGroupButtonVariants: (props?: ({
|
|
|
13
13
|
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
|
14
14
|
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
15
15
|
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
16
|
-
declare const InputGroupTextarea: React.ForwardRefExoticComponent<
|
|
17
|
-
value?: import('rc-textarea/lib/interface').HTMLTextareaProps["value"] | bigint;
|
|
18
|
-
prefixCls?: string;
|
|
19
|
-
className?: string;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
autoSize?: boolean | import('rc-textarea').AutoSizeType;
|
|
22
|
-
onPressEnter?: React.KeyboardEventHandler<HTMLTextAreaElement>;
|
|
23
|
-
onResize?: (size: {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
}) => void;
|
|
27
|
-
classNames?: import('rc-input/lib/interface').CommonInputProps["classNames"] & {
|
|
28
|
-
textarea?: string;
|
|
29
|
-
count?: string;
|
|
30
|
-
};
|
|
31
|
-
styles?: {
|
|
32
|
-
textarea?: React.CSSProperties;
|
|
33
|
-
count?: React.CSSProperties;
|
|
34
|
-
};
|
|
35
|
-
} & Pick<import('rc-input/lib/interface').BaseInputProps, "allowClear" | "suffix"> & Pick<import('rc-input').InputProps, "showCount" | "count" | "onClear"> & React.RefAttributes<TextAreaRef>>;
|
|
16
|
+
declare const InputGroupTextarea: React.ForwardRefExoticComponent<React.PropsWithoutRef<TextAreaProps> & React.RefAttributes<TextAreaRef>>;
|
|
36
17
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.es.js","sources":["../../../../src/components/ui/inputGroup/input-group.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { TextAreaProps, TextAreaRef } from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Textarea } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <span\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"bg-white group/input-group border-input dark:bg-input/30 relative flex items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex shrink-0 gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n);\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n}\n\nconst InputGroupTextarea = React.forwardRef<TextAreaRef, TextAreaProps>(\n ({ className, ...props }, ref) => {\n return (\n <Textarea\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 max-w-none flex-1 resize-none rounded-none border-0 bg-transparent py-1.5 shadow-none dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n }\n);\nInputGroupTextarea.displayName = \"InputGroupTextarea\";\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"names":["InputGroup","className","props","jsx","cn","inputGroupButtonVariants","cva","InputGroupButton","type","variant","size","Button","InputGroupTextarea","React","ref","Textarea"],"mappings":";;;;;;AASA,SAASA,EAAW,EAAE,WAAAC,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAWC;AAAA,QACT;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QAEAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AA6CA,MAAMG,IAA2BC;AAAA,EAC/B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WACE;AAAA,QACF,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,SAASC,EAAiB;AAAA,EACxB,WAAAN;AAAA,EACA,MAAAO,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,GAAGR;AACL,GACiD;AAC/C,SACE,gBAAAC;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,MAAAH;AAAA,MACA,aAAWE;AAAA,MACX,SAAAD;AAAA,MACA,WAAWL,EAAGC,EAAyB,EAAE,MAAAK,EAAA,CAAM,GAAGT,CAAS;AAAA,MAC1D,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AA8BA,MAAMU,
|
|
1
|
+
{"version":3,"file":"input-group.es.js","sources":["../../../../src/components/ui/inputGroup/input-group.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { TextAreaProps, TextAreaRef } from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Textarea } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <span\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"bg-white group/input-group border-input dark:bg-input/30 relative flex items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex shrink-0 gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n);\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n}\n\nconst InputGroupTextarea: React.ForwardRefExoticComponent<\n React.PropsWithoutRef<TextAreaProps> & React.RefAttributes<TextAreaRef>\n> = React.forwardRef<TextAreaRef, TextAreaProps>(\n ({ className, ...props }, ref) => {\n return (\n <Textarea\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n \"min-w-0 max-w-none flex-1 resize-none rounded-none border-0 bg-transparent py-1.5 shadow-none dark:bg-transparent\",\n className\n )}\n {...props}\n />\n );\n }\n);\nInputGroupTextarea.displayName = \"InputGroupTextarea\";\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"names":["InputGroup","className","props","jsx","cn","inputGroupButtonVariants","cva","InputGroupButton","type","variant","size","Button","InputGroupTextarea","React","ref","Textarea"],"mappings":";;;;;;AASA,SAASA,EAAW,EAAE,WAAAC,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAWC;AAAA,QACT;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QAEAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AA6CA,MAAMG,IAA2BC;AAAA,EAC/B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WACE;AAAA,QACF,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,SAASC,EAAiB;AAAA,EACxB,WAAAN;AAAA,EACA,MAAAO,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,GAAGR;AACL,GACiD;AAC/C,SACE,gBAAAC;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,MAAAH;AAAA,MACA,aAAWE;AAAA,MACX,SAAAD;AAAA,MACA,WAAWL,EAAGC,EAAyB,EAAE,MAAAK,EAAA,CAAM,GAAGT,CAAS;AAAA,MAC1D,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AA8BA,MAAMU,IAEFC,EAAM;AAAA,EACR,CAAC,EAAE,WAAAZ,GAAW,GAAGC,EAAA,GAASY,MAEtB,gBAAAX;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACV,WAAWV;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAIZ;AACAU,EAAmB,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("react"),u=require("../../../node_modules/rc-textarea/es/TextArea.cjs");require("../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("react"),u=require("../../../node_modules/rc-textarea/es/TextArea.cjs");require("../../../_virtual/index4.cjs");require("../../../node_modules/rc-resize-observer/es/index.cjs");require("../../../node_modules/rc-util/es/hooks/useLayoutEffect.cjs");require("../../../node_modules/rc-util/es/raf.cjs");const s=require("../../../lib/utils.cjs");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=c(d),i=l.forwardRef(({className:e,autoSize:t={minRows:1},style:r,...a},n)=>o.jsx(u.default,{ref:n,autoSize:t,className:s.cn("border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 w-full rounded-md border bg-transparent pl-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50","resize-none",e),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...r},...a}));i.displayName="Textarea";exports.Textarea=i;
|
|
2
2
|
//# sourceMappingURL=textarea.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.cjs","sources":["../../../../src/components/ui/inputGroup/textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport RcTextArea, {\n TextAreaProps as RcTextAreaProps,\n TextAreaRef,\n} from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\n\ntype TextareaProps = RcTextAreaProps;\n\nconst Textarea = React.forwardRef<TextAreaRef, TextareaProps>(\n ({ className, autoSize = { minRows: 1 }, style, ...props }, ref) => {\n return (\n <RcTextArea\n ref={ref}\n autoSize={autoSize}\n className={cn(\n \"border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 w-full rounded-md border bg-transparent pl-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"resize-none\",\n className\n )}\n style={{\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n ...style,\n }}\n {...props}\n />\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","autoSize","style","props","ref","jsx","RcTextArea","cn"],"mappings":"8uBAWMA,
|
|
1
|
+
{"version":3,"file":"textarea.cjs","sources":["../../../../src/components/ui/inputGroup/textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport RcTextArea, {\n TextAreaProps as RcTextAreaProps,\n TextAreaRef,\n} from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\n\ntype TextareaProps = RcTextAreaProps;\n\nconst Textarea: React.ForwardRefExoticComponent<\n React.PropsWithoutRef<TextareaProps> & React.RefAttributes<TextAreaRef>\n> = React.forwardRef<TextAreaRef, TextareaProps>(\n ({ className, autoSize = { minRows: 1 }, style, ...props }, ref) => {\n return (\n <RcTextArea\n ref={ref}\n autoSize={autoSize}\n className={cn(\n \"border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 w-full rounded-md border bg-transparent pl-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"resize-none\",\n className\n )}\n style={{\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n ...style,\n }}\n {...props}\n />\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","autoSize","style","props","ref","jsx","RcTextArea","cn"],"mappings":"8uBAWMA,EAEFC,EAAM,WACR,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAW,CAAE,QAAS,CAAA,EAAK,MAAAC,EAAO,GAAGC,CAAA,EAASC,IAExDC,EAAAA,IAACC,EAAAA,QAAA,CACC,IAAAF,EACA,SAAAH,EACA,UAAWM,EAAAA,GACT,4UACA,cACAP,CAAA,EAEF,MAAO,CACL,WAAY,WACZ,UAAW,aACX,GAAGE,CAAA,EAEJ,GAAGC,CAAA,CAAA,CAIZ,EAEAL,EAAS,YAAc"}
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
import { TextAreaRef } from 'rc-textarea';
|
|
1
|
+
import { TextAreaProps as RcTextAreaProps, TextAreaRef } from 'rc-textarea';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
prefixCls?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
autoSize?: boolean | import('rc-textarea').AutoSizeType;
|
|
9
|
-
onPressEnter?: React.KeyboardEventHandler<HTMLTextAreaElement>;
|
|
10
|
-
onResize?: (size: {
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
}) => void;
|
|
14
|
-
classNames?: import('rc-input/lib/interface').CommonInputProps["classNames"] & {
|
|
15
|
-
textarea?: string;
|
|
16
|
-
count?: string;
|
|
17
|
-
};
|
|
18
|
-
styles?: {
|
|
19
|
-
textarea?: React.CSSProperties;
|
|
20
|
-
count?: React.CSSProperties;
|
|
21
|
-
};
|
|
22
|
-
} & Pick<import('rc-input/lib/interface').BaseInputProps, "allowClear" | "suffix"> & Pick<import('rc-input').InputProps, "showCount" | "count" | "onClear"> & React.RefAttributes<TextAreaRef>>;
|
|
3
|
+
type TextareaProps = RcTextAreaProps;
|
|
4
|
+
declare const Textarea: React.ForwardRefExoticComponent<React.PropsWithoutRef<TextareaProps> & React.RefAttributes<TextAreaRef>>;
|
|
23
5
|
export { Textarea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
3
|
import n from "../../../node_modules/rc-textarea/es/TextArea.es.js";
|
|
4
|
-
import "../../../_virtual/index.
|
|
4
|
+
import "../../../_virtual/index.es4.js";
|
|
5
5
|
import "../../../node_modules/rc-resize-observer/es/index.es.js";
|
|
6
6
|
import "../../../node_modules/rc-util/es/hooks/useLayoutEffect.es.js";
|
|
7
7
|
import "../../../node_modules/rc-util/es/raf.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.es.js","sources":["../../../../src/components/ui/inputGroup/textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport RcTextArea, {\n TextAreaProps as RcTextAreaProps,\n TextAreaRef,\n} from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\n\ntype TextareaProps = RcTextAreaProps;\n\nconst Textarea = React.forwardRef<TextAreaRef, TextareaProps>(\n ({ className, autoSize = { minRows: 1 }, style, ...props }, ref) => {\n return (\n <RcTextArea\n ref={ref}\n autoSize={autoSize}\n className={cn(\n \"border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 w-full rounded-md border bg-transparent pl-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"resize-none\",\n className\n )}\n style={{\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n ...style,\n }}\n {...props}\n />\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","autoSize","style","props","ref","jsx","RcTextArea","cn"],"mappings":";;;;;;;;AAWA,MAAMA,
|
|
1
|
+
{"version":3,"file":"textarea.es.js","sources":["../../../../src/components/ui/inputGroup/textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport RcTextArea, {\n TextAreaProps as RcTextAreaProps,\n TextAreaRef,\n} from \"rc-textarea\";\n\nimport { cn } from \"../../../lib/utils\";\n\ntype TextareaProps = RcTextAreaProps;\n\nconst Textarea: React.ForwardRefExoticComponent<\n React.PropsWithoutRef<TextareaProps> & React.RefAttributes<TextAreaRef>\n> = React.forwardRef<TextAreaRef, TextareaProps>(\n ({ className, autoSize = { minRows: 1 }, style, ...props }, ref) => {\n return (\n <RcTextArea\n ref={ref}\n autoSize={autoSize}\n className={cn(\n \"border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 w-full rounded-md border bg-transparent pl-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"resize-none\",\n className\n )}\n style={{\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n ...style,\n }}\n {...props}\n />\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","autoSize","style","props","ref","jsx","RcTextArea","cn"],"mappings":";;;;;;;;AAWA,MAAMA,IAEFC,EAAM;AAAA,EACR,CAAC,EAAE,WAAAC,GAAW,UAAAC,IAAW,EAAE,SAAS,EAAA,GAAK,OAAAC,GAAO,GAAGC,EAAA,GAASC,MAExD,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,UAAAH;AAAA,MACA,WAAWM;AAAA,QACT;AAAA,QACA;AAAA,QACAP;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,GAAGE;AAAA,MAAA;AAAA,MAEJ,GAAGC;AAAA,IAAA;AAAA,EAAA;AAIZ;AAEAL,EAAS,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("../../@babel/runtime/helpers/esm/objectSpread2.cjs"),te=require("../../@babel/runtime/helpers/esm/extends.cjs"),i=require("../../@babel/runtime/helpers/esm/defineProperty.cjs"),oe=require("../../@babel/runtime/helpers/esm/typeof.cjs"),u=require("../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("../../@babel/runtime/helpers/esm/objectSpread2.cjs"),te=require("../../@babel/runtime/helpers/esm/extends.cjs"),i=require("../../@babel/runtime/helpers/esm/defineProperty.cjs"),oe=require("../../@babel/runtime/helpers/esm/typeof.cjs"),u=require("../../../_virtual/index4.cjs"),n=require("react"),T=require("./utils/commonUtils.cjs");var de=n.forwardRef(function(e,U){var p,x,y,$=e.inputElement,N=e.children,r=e.prefixCls,k=e.prefix,f=e.suffix,C=e.addonBefore,W=e.addonAfter,z=e.className,J=e.style,m=e.disabled,I=e.readOnly,K=e.focused,E=e.triggerFocus,d=e.allowClear,b=e.value,h=e.handleReset,L=e.hidden,t=e.classes,a=e.classNames,g=e.dataAttrs,o=e.styles,l=e.components,w=e.onClear,M=N??$,Q=l?.affixWrapper||"span",V=l?.groupWrapper||"span",X=l?.wrapper||"span",S=l?.groupAddon||"span",A=n.useRef(null),Y=function(s){var q;(q=A.current)!==null&&q!==void 0&&q.contains(s.target)&&E?.()},j=T.hasPrefixSuffix(e),c=n.cloneElement(M,{value:b,className:u.default((p=M.props)===null||p===void 0?void 0:p.className,!j&&a?.variant)||null}),B=n.useRef(null);if(n.useImperativeHandle(U,function(){return{nativeElement:B.current||A.current}}),j){var D=null;if(d){var Z=!m&&!I&&b,R="".concat(r,"-clear-icon"),P=oe.default(d)==="object"&&d!==null&&d!==void 0&&d.clearIcon?d.clearIcon:"✖";D=n.createElement("button",{type:"button",tabIndex:-1,onClick:function(s){h?.(s),w?.()},onMouseDown:function(s){return s.preventDefault()},className:u.default(R,i.default(i.default({},"".concat(R,"-hidden"),!Z),"".concat(R,"-has-suffix"),!!f))},P)}var v="".concat(r,"-affix-wrapper"),ee=u.default(v,i.default(i.default(i.default(i.default(i.default({},"".concat(r,"-disabled"),m),"".concat(v,"-disabled"),m),"".concat(v,"-focused"),K),"".concat(v,"-readonly"),I),"".concat(v,"-input-with-clear-btn"),f&&d&&b),t?.affixWrapper,a?.affixWrapper,a?.variant),ae=(f||d)&&n.createElement("span",{className:u.default("".concat(r,"-suffix"),a?.suffix),style:o?.suffix},D,f);c=n.createElement(Q,te.default({className:ee,style:o?.affixWrapper,onClick:Y},g?.affixWrapper,{ref:A}),k&&n.createElement("span",{className:u.default("".concat(r,"-prefix"),a?.prefix),style:o?.prefix},k),c,ae)}if(T.hasAddon(e)){var _="".concat(r,"-group"),O="".concat(_,"-addon"),F="".concat(_,"-wrapper"),ne=u.default("".concat(r,"-wrapper"),_,t?.wrapper,a?.wrapper),le=u.default(F,i.default({},"".concat(F,"-disabled"),m),t?.group,a?.groupWrapper);c=n.createElement(V,{className:le,ref:B},n.createElement(X,{className:ne},C&&n.createElement(S,{className:O},C),c,W&&n.createElement(S,{className:O},W)))}return n.cloneElement(c,{className:u.default((x=c.props)===null||x===void 0?void 0:x.className,z)||null,style:H.default(H.default({},(y=c.props)===null||y===void 0?void 0:y.style),J),hidden:L})});exports.default=de;
|
|
2
2
|
//# sourceMappingURL=BaseInput.cjs.map
|
|
@@ -2,7 +2,7 @@ import $ from "../../@babel/runtime/helpers/esm/objectSpread2.es.js";
|
|
|
2
2
|
import oe from "../../@babel/runtime/helpers/esm/extends.es.js";
|
|
3
3
|
import r from "../../@babel/runtime/helpers/esm/defineProperty.es.js";
|
|
4
4
|
import te from "../../@babel/runtime/helpers/esm/typeof.es.js";
|
|
5
|
-
import d from "../../../_virtual/index.
|
|
5
|
+
import d from "../../../_virtual/index.es4.js";
|
|
6
6
|
import l, { useRef as q, cloneElement as ie } from "react";
|
|
7
7
|
import { hasPrefixSuffix as re, hasAddon as de } from "./utils/commonUtils.es.js";
|
|
8
8
|
var xe = /* @__PURE__ */ l.forwardRef(function(e, z) {
|