@elliemae/ds-dropzone 3.50.1-next.8 → 3.51.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSDropzone.js +1 -1
- package/dist/cjs/DSDropzone.js.map +2 -2
- package/dist/cjs/config/useDSDropzone.js.map +2 -2
- package/dist/cjs/parts/DSActivezone/DSActivezone.js +1 -1
- package/dist/cjs/parts/DSActivezone/DSActivezone.js.map +2 -2
- package/dist/cjs/parts/DSActivezone/config/useActivezone.js.map +2 -2
- package/dist/esm/DSDropzone.js +1 -1
- package/dist/esm/DSDropzone.js.map +2 -2
- package/dist/esm/config/useDSDropzone.js.map +2 -2
- package/dist/esm/parts/DSActivezone/DSActivezone.js +1 -1
- package/dist/esm/parts/DSActivezone/DSActivezone.js.map +2 -2
- package/dist/esm/parts/DSActivezone/config/useActivezone.js.map +2 -2
- package/dist/types/config/useDSDropzone.d.ts +1 -1
- package/dist/types/parts/DSActivezone/config/useActivezone.d.ts +1 -1
- package/package.json +12 -12
package/dist/cjs/DSDropzone.js
CHANGED
|
@@ -36,12 +36,12 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
+
var import_lodash = require("lodash");
|
|
39
40
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
41
|
var import_useDSDropzone = require("./config/useDSDropzone.js");
|
|
41
42
|
var import_constants = require("./constants/index.js");
|
|
42
43
|
var import_styled = require("./styled.js");
|
|
43
44
|
var import_DSActivezone = require("./parts/DSActivezone/DSActivezone.js");
|
|
44
|
-
var import_lodash = require("lodash");
|
|
45
45
|
const DSDropzone = (props) => {
|
|
46
46
|
const {
|
|
47
47
|
propsWithDefault,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDropzone.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BjB;AA/BN,mBAAkB;AAClB,8BAAyB;AACzB,mCAA4D;AAC5D,2BAA8B;AAC9B,uBAA+B;AAC/B,oBAAqD;AACrD,0BAA6B;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { omit } from 'lodash';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const safeGlobalProps = omit(globalProps, 'onDrop', 'hasError');\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BjB;AA/BN,mBAAkB;AAClB,8BAAyB;AACzB,oBAAqB;AACrB,mCAA4D;AAC5D,2BAA8B;AAC9B,uBAA+B;AAC/B,oBAAqD;AACrD,0BAA6B;AAE7B,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,oCAAc,KAAK;AACvB,QAAM,gBAAgB,aAAAA,QAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyB,aAAAA,QAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/D,QAAM,sBAAkB,oBAAK,aAAa,UAAU,UAAU;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,MAE3C;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,QAAQ;AAAA,UACR,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,cAAc;AAAA,UACd;AAAA,UACA;AAAA,UAEC;AAAA,6BAAiB;AAAA,YACjB,eAAe,4CAAC,oCAAa,IAAK;AAAA;AAAA;AAAA,MACrC;AAAA;AAAA,EACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useDSDropzone.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id, disabled, onDrop } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const [isDragInside, setIsDragInside] = React.useState(false);\n\n const onBodyDragDropEvent = React.useCallback((e: Event) => {\n e.preventDefault();\n }, []);\n\n /**\n * Prevent default open file in browser\n */\n React.useEffect(() => {\n document.body.addEventListener('drop', onBodyDragDropEvent);\n return () => {\n document.body.removeEventListener('drop', onBodyDragDropEvent);\n };\n }, [onBodyDragDropEvent]);\n\n const onDragEnterHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) setIsDragInside(true);\n },\n [disabled],\n );\n const onDragOverHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const onDragLeaveHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n if (e.relatedTarget !== e.currentTarget && !e.currentTarget.contains(e.relatedTarget as Node)) {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n }\n }, []);\n const onDropHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n const filesArray = Array.from(e.dataTransfer?.files ?? []);\n onDrop?.(filesArray, e);\n },\n [onDrop],\n );\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAoE;AACpE,8BAAiC;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,uBAAmB,sDAAwD,eAAe,yCAAY;AAC5G,gDAAiB,kBAAkB,gDAAmB;AAItD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,EAAE,IAAI,UAAU,OAAO,IAAI;AACjC,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAI1D,QAAM,CAAC,cAAc,eAAe,IAAI,aAAAA,QAAM,SAAS,KAAK;AAE5D,QAAM,sBAAsB,aAAAA,QAAM,YAAY,CAAC,MAAa;AAC1D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAKL,eAAAA,QAAM,UAAU,MAAM;AACpB,aAAS,KAAK,iBAAiB,QAAQ,mBAAmB;AAC1D,WAAO,MAAM;AACX,eAAS,KAAK,oBAAoB,QAAQ,mBAAmB;AAAA,IAC/D;AAAA,EACF,GAAG,CAAC,mBAAmB,CAAC;AAExB,QAAM,qBAA6D,aAAAA,QAAM;AAAA,IACvE,CAAC,MAAM;AACL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,CAAC,SAAU,iBAAgB,IAAI;AAAA,IACrC;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,oBAA4D,aAAAA,QAAM,YAAY,CAAC,MAAM;AACzF,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB,GAAG,CAAC,CAAC;AACL,QAAM,qBAA6D,aAAAA,QAAM,YAAY,CAAC,MAAM;AAC1F,QAAI,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;AAC7F,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,QAAM,gBAAwD,aAAAA,QAAM;AAAA,IAClE,CAAC,MAAM;AACL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AACrB,YAAM,aAAa,MAAM,KAAK,EAAE,cAAc,SAAS,CAAC,CAAC;AACzD,eAAS,YAAY,CAAC;AAAA,IACxB;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -36,10 +36,10 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_ds_hooks_fontsize_media = require("@elliemae/ds-hooks-fontsize-media");
|
|
39
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
39
|
var import_ds_system = require("@elliemae/ds-system");
|
|
41
40
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
42
41
|
var import_ds_typography = require("@elliemae/ds-typography");
|
|
42
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
43
43
|
var import_useActivezone = require("./config/useActivezone.js");
|
|
44
44
|
var import_constants = require("../../constants/index.js");
|
|
45
45
|
const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSDropzoneName, slot: import_constants.DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSActivezone/DSActivezone.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmCnB;AAlCJ,8BAAyB;AACzB,qCAAiC;AACjC,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={() => propsWithDefault}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledIcon justifyContent=\"center\">\n <Icon size=\"l\" color={['neutral', '0']} />\n </StyledIcon>\n <StyledLabel variant=\"b2\" color=\"neutral-000\">\n {label}\n </StyledLabel>\n </StyledWrapper>\n );\n};\n\nDSActivezone.displayName = 'DSActivezone';\nconst DSActivezoneWithSchema = describe(DSActivezone);\nDSActivezoneWithSchema.propTypes = DSActivezonePropTypesSchema;\n\nexport { DSActivezone, DSActivezoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmCnB;AAlCJ,8BAAyB;AACzB,qCAAiC;AACjC,uBAAuB;AACvB,qBAAqB;AACrB,2BAA6B;AAC7B,mCAAgE;AAChE,2BAA8B;AAC9B,uBAAoE;AAEpE,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,mBAAmB,CAAC;AAAA;AAAA;AAAA,mBAGjF,qCAAoB,aAAa;AAAA,aACvC,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9C,MAAM,kBAAc,yBAAO,mCAAc,EAAE,MAAM,iCAAgB,MAAM,gCAAe,iBAAiB,CAAC;AACxG,MAAM,iBAAa,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,gBAAgB,CAAC;AAE9F,MAAM,UAAU;AAAA,EACd,WAAW,CAAC,MAAM;AAAA,EAClB,YAAY,CAAC,QAAQ,MAAM;AAAA,EAC3B,WAAW,CAAC,QAAQ,MAAM;AAC5B;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,oCAAc,KAAK;AAC3E,QAAM,EAAE,MAAM,MAAM,IAAI;AACxB,QAAM,sBAAkB,iDAAiB,OAAO;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,CAAC,MAAM;AAAA,MACb,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,IAAG;AAAA,MACH,QAAO;AAAA,MACP,MAAM;AAAA,MACN,eAAe,MAAM;AAAA,MACpB,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,oDAAC,cAAW,gBAAe,UACzB,sDAAC,QAAK,MAAK,KAAI,OAAO,CAAC,WAAW,GAAG,GAAG,GAC1C;AAAA,QACA,4CAAC,eAAY,SAAQ,MAAK,OAAM,eAC7B,iBACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/DSActivezone/config/useActivezone.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAwE;AACxE,8BAAiC;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,uBAAmB,sDAA0D,eAAe,yCAAY;AAC9G,gDAAiB,kBAAkB,kDAAqB;AAIxD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAO1D,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/esm/DSDropzone.js
CHANGED
|
@@ -2,12 +2,12 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { omit } from "lodash";
|
|
5
6
|
import { DSDropzonePropTypesSchema } from "./react-desc-prop-types.js";
|
|
6
7
|
import { useDSDropzone } from "./config/useDSDropzone.js";
|
|
7
8
|
import { DSDropzoneName } from "./constants/index.js";
|
|
8
9
|
import { StyledDropZone, StyledDropZoneHolder } from "./styled.js";
|
|
9
10
|
import { DSActivezone } from "./parts/DSActivezone/DSActivezone.js";
|
|
10
|
-
import { omit } from "lodash";
|
|
11
11
|
const DSDropzone = (props) => {
|
|
12
12
|
const {
|
|
13
13
|
propsWithDefault,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSDropzone.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC+BjB,SAYkB,KAZlB;AA/BN,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAA2B,iCAAiC;AAC5D,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,oBAAoB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { omit } from 'lodash';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const safeGlobalProps = omit(globalProps, 'onDrop', 'hasError');\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+BjB,SAYkB,KAZlB;AA/BN,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAA2B,iCAAiC;AAC5D,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,oBAAoB;AAE7B,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,cAAc,KAAK;AACvB,QAAM,gBAAgBA,OAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyBA,OAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/D,QAAM,kBAAkB,KAAK,aAAa,UAAU,UAAU;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,MAE3C;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,QAAQ;AAAA,UACR,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,cAAc;AAAA,UACd;AAAA,UACA;AAAA,UAEC;AAAA,6BAAiB;AAAA,YACjB,eAAe,oBAAC,gBAAa,IAAK;AAAA;AAAA;AAAA,MACrC;AAAA;AAAA,EACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useDSDropzone.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id, disabled, onDrop } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const [isDragInside, setIsDragInside] = React.useState(false);\n\n const onBodyDragDropEvent = React.useCallback((e: Event) => {\n e.preventDefault();\n }, []);\n\n /**\n * Prevent default open file in browser\n */\n React.useEffect(() => {\n document.body.addEventListener('drop', onBodyDragDropEvent);\n return () => {\n document.body.removeEventListener('drop', onBodyDragDropEvent);\n };\n }, [onBodyDragDropEvent]);\n\n const onDragEnterHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) setIsDragInside(true);\n },\n [disabled],\n );\n const onDragOverHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const onDragLeaveHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n if (e.relatedTarget !== e.currentTarget && !e.currentTarget.contains(e.relatedTarget as Node)) {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n }\n }, []);\n const onDropHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n const filesArray = Array.from(e.dataTransfer?.files ?? []);\n onDrop?.(filesArray, e);\n },\n [onDrop],\n );\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA2B,qBAAqB,oBAAoB;AACpE,SAAS,wBAAwB;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,mBAAmB,6BAAwD,eAAe,YAAY;AAC5G,mBAAiB,kBAAkB,mBAAmB;AAItD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,EAAE,IAAI,UAAU,OAAO,IAAI;AACjC,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAI1D,QAAM,CAAC,cAAc,eAAe,IAAIA,OAAM,SAAS,KAAK;AAE5D,QAAM,sBAAsBA,OAAM,YAAY,CAAC,MAAa;AAC1D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAKL,EAAAA,OAAM,UAAU,MAAM;AACpB,aAAS,KAAK,iBAAiB,QAAQ,mBAAmB;AAC1D,WAAO,MAAM;AACX,eAAS,KAAK,oBAAoB,QAAQ,mBAAmB;AAAA,IAC/D;AAAA,EACF,GAAG,CAAC,mBAAmB,CAAC;AAExB,QAAM,qBAA6DA,OAAM;AAAA,IACvE,CAAC,MAAM;AACL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,CAAC,SAAU,iBAAgB,IAAI;AAAA,IACrC;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,oBAA4DA,OAAM,YAAY,CAAC,MAAM;AACzF,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB,GAAG,CAAC,CAAC;AACL,QAAM,qBAA6DA,OAAM,YAAY,CAAC,MAAM;AAC1F,QAAI,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;AAC7F,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,QAAM,gBAAwDA,OAAM;AAAA,IAClE,CAAC,MAAM;AACL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AACrB,YAAM,aAAa,MAAM,KAAK,EAAE,cAAc,SAAS,CAAC,CAAC;AACzD,eAAS,YAAY,CAAC;AAAA,IACxB;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,10 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { useFontsizeMedia } from "@elliemae/ds-hooks-fontsize-media";
|
|
5
|
-
import { DSActivezonePropTypesSchema } from "./react-desc-prop-types.js";
|
|
6
5
|
import { styled } from "@elliemae/ds-system";
|
|
7
6
|
import { Grid } from "@elliemae/ds-grid";
|
|
8
7
|
import { DSTypography } from "@elliemae/ds-typography";
|
|
8
|
+
import { DSActivezonePropTypesSchema } from "./react-desc-prop-types.js";
|
|
9
9
|
import { useActivezone } from "./config/useActivezone.js";
|
|
10
10
|
import { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from "../../constants/index.js";
|
|
11
11
|
const StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSActivezone/DSActivezone.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACmCnB,SAYI,KAZJ;AAlCJ,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={() => propsWithDefault}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledIcon justifyContent=\"center\">\n <Icon size=\"l\" color={['neutral', '0']} />\n </StyledIcon>\n <StyledLabel variant=\"b2\" color=\"neutral-000\">\n {label}\n </StyledLabel>\n </StyledWrapper>\n );\n};\n\nDSActivezone.displayName = 'DSActivezone';\nconst DSActivezoneWithSchema = describe(DSActivezone);\nDSActivezoneWithSchema.propTypes = DSActivezonePropTypesSchema;\n\nexport { DSActivezone, DSActivezoneWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmCnB,SAYI,KAZJ;AAlCJ,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAA6B,mCAAmC;AAChE,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,qBAAqB,sBAAsB;AAEpE,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,mBAAmB,CAAC;AAAA;AAAA;AAAA,mBAGjF,oBAAoB,aAAa;AAAA,aACvC,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9C,MAAM,cAAc,OAAO,cAAc,EAAE,MAAM,gBAAgB,MAAM,eAAe,iBAAiB,CAAC;AACxG,MAAM,aAAa,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,gBAAgB,CAAC;AAE9F,MAAM,UAAU;AAAA,EACd,WAAW,CAAC,MAAM;AAAA,EAClB,YAAY,CAAC,QAAQ,MAAM;AAAA,EAC3B,WAAW,CAAC,QAAQ,MAAM;AAC5B;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,cAAc,KAAK;AAC3E,QAAM,EAAE,MAAM,MAAM,IAAI;AACxB,QAAM,kBAAkB,iBAAiB,OAAO;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,CAAC,MAAM;AAAA,MACb,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,IAAG;AAAA,MACH,QAAO;AAAA,MACP,MAAM;AAAA,MACN,eAAe,MAAM;AAAA,MACpB,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,4BAAC,cAAW,gBAAe,UACzB,8BAAC,QAAK,MAAK,KAAI,OAAO,CAAC,WAAW,GAAG,GAAG,GAC1C;AAAA,QACA,oBAAC,eAAY,SAAQ,MAAK,OAAM,eAC7B,iBACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSActivezone/config/useActivezone.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA6B,uBAAuB,oBAAoB;AACxE,SAAS,wBAAwB;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,mBAAmB,6BAA0D,eAAe,YAAY;AAC9G,mBAAiB,kBAAkB,qBAAqB;AAIxD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAO1D,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
|
-
import { type DSDropzoneT } from '../react-desc-prop-types.js';
|
|
4
3
|
import type { DSGridT } from '@elliemae/ds-grid';
|
|
4
|
+
import { type DSDropzoneT } from '../react-desc-prop-types.js';
|
|
5
5
|
export interface DropzoneCTX {
|
|
6
6
|
propsWithDefault: DSDropzoneT.InternalProps;
|
|
7
7
|
globalProps: ReturnType<typeof useGetGlobalAttributes>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DSActivezoneT } from '../react-desc-prop-types.js';
|
|
3
2
|
import type { DSGridT } from '@elliemae/ds-grid';
|
|
3
|
+
import { type DSActivezoneT } from '../react-desc-prop-types.js';
|
|
4
4
|
export declare const useActivezone: (propsFromUser: DSActivezoneT.Props) => {
|
|
5
5
|
propsWithDefault: DSActivezoneT.InternalProps;
|
|
6
6
|
globalProps: Partial<Pick<DSGridT.Props, "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap"> & Omit<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dropzone",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.51.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dropzone",
|
|
6
6
|
"files": [
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xstyled/styled-components": "~3.7.3",
|
|
40
40
|
"uid": "^2.0.2",
|
|
41
|
-
"@elliemae/ds-button": "3.
|
|
42
|
-
"@elliemae/ds-grid": "3.
|
|
43
|
-
"@elliemae/ds-hooks-fontsize-media": "3.
|
|
44
|
-
"@elliemae/ds-
|
|
45
|
-
"@elliemae/ds-
|
|
46
|
-
"@elliemae/ds-
|
|
47
|
-
"@elliemae/ds-
|
|
41
|
+
"@elliemae/ds-button": "3.51.0-next.0",
|
|
42
|
+
"@elliemae/ds-grid": "3.51.0-next.0",
|
|
43
|
+
"@elliemae/ds-hooks-fontsize-media": "3.51.0-next.0",
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.51.0-next.0",
|
|
45
|
+
"@elliemae/ds-icons": "3.51.0-next.0",
|
|
46
|
+
"@elliemae/ds-system": "3.51.0-next.0",
|
|
47
|
+
"@elliemae/ds-typography": "3.51.0-next.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
50
|
+
"@elliemae/pui-cli": "9.0.0-next.50",
|
|
51
51
|
"@xstyled/system": "~3.7.3",
|
|
52
52
|
"jest": "~29.7.0",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"styled-components": "~5.3.9",
|
|
55
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
55
|
+
"@elliemae/ds-monorepo-devops": "3.51.0-next.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
|
-
"react": "^
|
|
60
|
-
"react-dom": "^
|
|
59
|
+
"react": "^18.3.1",
|
|
60
|
+
"react-dom": "^18.3.1",
|
|
61
61
|
"styled-components": "~5.3.9"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|