@oneblink/apps-react 8.12.0-beta.7 → 8.12.0-beta.9

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.
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PercentCrop } from 'react-image-crop';
3
- import 'react-image-crop/src/ReactCrop.scss';
4
3
  export { PercentCrop };
5
4
  declare const _default: React.MemoExoticComponent<({ imgSrc, disabled, onCropComplete, outputAspectRatio, cropperHeight, }: {
6
5
  imgSrc: string;
@@ -1,7 +1,6 @@
1
1
  import React, { memo, useEffect } from 'react';
2
2
  import ReactImageCrop from 'react-image-crop';
3
3
  import { CropContainer } from './resource-components';
4
- import 'react-image-crop/src/ReactCrop.scss';
5
4
  import clsx from 'clsx';
6
5
  const defaultCrop = {
7
6
  unit: '%',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCropper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,cAAqC,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACL,CAAA;AAED,MAAM,6BAA6B,GAAG,CAAC,EACrC,iBAAiB,EACjB,UAAU,EACV,WAAW,GAKZ,EAAe,EAAE;IAChB,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;IAE5C,wFAAwF;IACxF,IAAI,KAAa,CAAA;IACjB,IAAI,MAAc,CAAA;IAClB,IAAI,WAAW,IAAI,iBAAiB,EAAE,CAAC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BAAqB,GAAG,GAAG,EAAE,CACjC,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAA;IAElD,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAA;IAC5C,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAA;IAE7C,aAAa,CAAC,KAAK,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,oBAAoB,EAAE,CAAA;IAC3D,aAAa,CAAC,MAAM,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,mCAAI,qBAAqB,EAAE,CAAA;IAE9D,4DAA4D;IAC5D,UAAU,CAAC,SAAS,CAClB,MAAM;IACN,WAAW;IACX,sBAAsB,EAAE;IACxB,WAAW;IACX,sBAAsB,EAAE;IACxB,eAAe;IACf,oBAAoB,EAAE;IACtB,gBAAgB;IAChB,qBAAqB,EAAE;IACvB,gBAAgB;IAChB,CAAC;IACD,gBAAgB;IAChB,CAAC;IACD,oBAAoB;IACpB,aAAa,CAAC,KAAK;IACnB,qBAAqB;IACrB,aAAa,CAAC,MAAM,CACrB,CAAA;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,EAAE,QAAQ,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { memo, useEffect } from 'react'\nimport ReactImageCrop, { Crop, PercentCrop } from 'react-image-crop'\nimport { CropContainer } from './resource-components'\nimport 'react-image-crop/src/ReactCrop.scss'\nimport clsx from 'clsx'\nexport { PercentCrop }\nconst defaultCrop: PercentCrop = {\n unit: '%',\n height: 100,\n width: 100,\n x: 0,\n y: 0,\n}\n\nconst getDefaultCropFromAspectRatio = ({\n outputAspectRatio,\n imageWidth,\n imageHeight,\n}: {\n outputAspectRatio: number\n imageWidth: number\n imageHeight: number\n}): PercentCrop => {\n const imageAspect = imageWidth / imageHeight\n\n // Compute the largest rectangle that fits within the image and matches the aspect ratio\n let width: number\n let height: number\n if (imageAspect >= outputAspectRatio) {\n // Image is wider than desired aspect: constrain width by the height\n height = 100\n const widthInPixels = imageHeight * outputAspectRatio\n // as percent\n width = (widthInPixels / imageWidth) * 100\n } else {\n // Image is taller/narrower than desired aspect: constrain height by the width\n width = 100\n const heightInPixels = imageWidth * outputAspectRatio\n // as percent\n height = (heightInPixels / imageHeight) * 100\n }\n\n // Center the crop\n const x = Math.round((100 - width) / 2)\n const y = Math.round((100 - height) / 2)\n\n return {\n unit: '%',\n width,\n height,\n x,\n y,\n }\n}\n\nconst ImageCropper = ({\n imgSrc,\n disabled,\n onCropComplete,\n outputAspectRatio,\n cropperHeight,\n}: {\n imgSrc: string\n disabled?: boolean\n onCropComplete: (croppedAreaPixels: PercentCrop) => void\n outputAspectRatio?: number\n cropperHeight?: number\n}) => {\n const cropperWrapperRef = React.useRef<HTMLDivElement>(null)\n const imageRef = React.useRef<HTMLImageElement>(null)\n\n const [fullHeight, setFullHeight] = React.useState(false)\n\n const [crop, setCrop] = React.useState<Crop | undefined>(() =>\n outputAspectRatio ? undefined : defaultCrop,\n )\n\n const handleSetCrop = React.useCallback((_, c: PercentCrop) => {\n setCrop(c)\n }, [])\n\n const handleCropComplete = React.useCallback(\n (_, c: PercentCrop) => {\n onCropComplete(c)\n },\n [onCropComplete],\n )\n\n const handleLoadImage = React.useCallback(\n ({ currentTarget }: React.SyntheticEvent<HTMLImageElement, Event>) => {\n if (!outputAspectRatio) return\n setCrop(\n getDefaultCropFromAspectRatio({\n outputAspectRatio,\n imageWidth: currentTarget.width,\n imageHeight: currentTarget.height,\n }),\n )\n },\n [outputAspectRatio],\n )\n\n // Resize magic to account for images that are larger than the dialog can hold\n useEffect(() => {\n if (imageRef.current && cropperWrapperRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!cropperWrapperRef.current) continue\n\n const imageElHeight = entry.contentRect.height\n const cropperWrapperHeight = cropperWrapperRef.current.clientHeight\n\n if (Math.ceil(imageElHeight) < Math.ceil(cropperWrapperHeight)) {\n setFullHeight(false)\n } else {\n setFullHeight(true)\n }\n }\n })\n resizeObserver.observe(imageRef.current)\n\n return () => {\n resizeObserver.disconnect()\n }\n }\n }, [imageRef])\n\n return (\n <div className=\"ob-cropper__container\">\n <CropContainer\n className=\"ob-cropper__cropper-wrapper\"\n height={cropperHeight}\n ref={cropperWrapperRef}\n >\n <ReactImageCrop\n crop={crop}\n aspect={outputAspectRatio}\n onChange={handleSetCrop}\n onComplete={handleCropComplete}\n disabled={disabled}\n className={clsx('ob-cropper__cropper', {\n 'ob-cropper__cropper-full-height': fullHeight,\n })}\n ruleOfThirds\n keepSelection\n >\n <img\n src={imgSrc}\n className=\"ob-cropper__image\"\n onLoad={handleLoadImage}\n ref={imageRef}\n />\n </ReactImageCrop>\n </CropContainer>\n </div>\n )\n}\n\nexport default memo(ImageCropper)\n\nexport const getAspectRatio = ({\n width,\n height,\n}: {\n width: number\n height: number\n}) => width / height\n\nconst createImage = (url: string): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const image = new Image()\n image.onload = () => {\n resolve(image)\n }\n image.onerror = (error) => {\n reject(error)\n }\n image.src = url\n return image\n })\n}\n\nexport const generateCroppedImageBlob = async ({\n croppedAreaPercent,\n imgSrc,\n size,\n fileType,\n}: {\n croppedAreaPercent: PercentCrop\n imgSrc: string\n /**\n * If provided, the cropped image will be resized to the given size. If not\n * provided, the cropped image will be the same size as the cropped portion of\n * the source image.\n */\n size?: {\n width: number\n height: number\n }\n fileType?: string\n}): Promise<Blob | null> => {\n if (!croppedAreaPercent || !imgSrc) {\n return null\n }\n // Source image/canvas\n const image = await createImage(imgSrc)\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n return null\n }\n canvas.width = image.width\n canvas.height = image.height\n ctx.drawImage(image, 0, 0)\n\n // Destination image/canvas\n const croppedCanvas = document.createElement('canvas')\n const croppedCtx = croppedCanvas.getContext('2d')\n if (!croppedCtx) {\n return null\n }\n\n const widthPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.width\n const heightPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.height\n\n const sourceXPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.x\n const sourceYPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.y\n\n croppedCanvas.width = size?.width ?? widthPercentAsPixels()\n croppedCanvas.height = size?.height ?? heightPercentAsPixels()\n\n // Draw the cropped source image onto the destination canvas\n croppedCtx.drawImage(\n canvas,\n // source x\n sourceXPercentAsPixels(),\n // source y\n sourceYPercentAsPixels(),\n // source width\n widthPercentAsPixels(),\n // source height\n heightPercentAsPixels(),\n // destination x\n 0,\n // destination y\n 0,\n // destination width\n croppedCanvas.width,\n // destination height\n croppedCanvas.height,\n )\n\n return new Promise((resolve) => {\n croppedCanvas.toBlob((file) => {\n resolve(file)\n }, fileType)\n })\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCropper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,cAAqC,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,KAAK,EAAE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AO,EAAE,EAAE;QAC7B,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,EAAE,QAAQ,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { memo, useEffect } from 'react'\nimport ReactImageCrop, { Crop, PercentCrop } from 'react-image-crop'\nimport { CropContainer } from './resource-components'\n\nimport clsx from 'clsx'\nexport { PercentCrop }\nconst defaultCrop: PercentCrop = {\n unit: '%',\n height: 100,\n width: 100,\n x: 0,\n y: 0,\n}\n\nconst getDefaultCropFromAspectRatio = ({\n outputAspectRatio,\n imageWidth,\n imageHeight,\n}: {\n outputAspectRatio: number\n imageWidth: number\n imageHeight: number\n}): PercentCrop => {\n const imageAspect = imageWidth / imageHeight\n\n // Compute the largest rectangle that fits within the image and matches the aspect ratio\n let width: number\n let height: number\n if (imageAspect >= outputAspectRatio) {\n // Image is wider than desired aspect: constrain width by the height\n height = 100\n const widthInPixels = imageHeight * outputAspectRatio\n // as percent\n width = (widthInPixels / imageWidth) * 100\n } else {\n // Image is taller/narrower than desired aspect: constrain height by the width\n width = 100\n const heightInPixels = imageWidth * outputAspectRatio\n // as percent\n height = (heightInPixels / imageHeight) * 100\n }\n\n // Center the crop\n const x = Math.round((100 - width) / 2)\n const y = Math.round((100 - height) / 2)\n\n return {\n unit: '%',\n width,\n height,\n x,\n y,\n }\n}\n\nconst ImageCropper = ({\n imgSrc,\n disabled,\n onCropComplete,\n outputAspectRatio,\n cropperHeight,\n}: {\n imgSrc: string\n disabled?: boolean\n onCropComplete: (croppedAreaPixels: PercentCrop) => void\n outputAspectRatio?: number\n cropperHeight?: number\n}) => {\n const cropperWrapperRef = React.useRef<HTMLDivElement>(null)\n const imageRef = React.useRef<HTMLImageElement>(null)\n\n const [fullHeight, setFullHeight] = React.useState(false)\n\n const [crop, setCrop] = React.useState<Crop | undefined>(() =>\n outputAspectRatio ? undefined : defaultCrop,\n )\n\n const handleSetCrop = React.useCallback((_, c: PercentCrop) => {\n setCrop(c)\n }, [])\n\n const handleCropComplete = React.useCallback(\n (_, c: PercentCrop) => {\n onCropComplete(c)\n },\n [onCropComplete],\n )\n\n const handleLoadImage = React.useCallback(\n ({ currentTarget }: React.SyntheticEvent<HTMLImageElement, Event>) => {\n if (!outputAspectRatio) return\n setCrop(\n getDefaultCropFromAspectRatio({\n outputAspectRatio,\n imageWidth: currentTarget.width,\n imageHeight: currentTarget.height,\n }),\n )\n },\n [outputAspectRatio],\n )\n\n // Resize magic to account for images that are larger than the dialog can hold\n useEffect(() => {\n if (imageRef.current && cropperWrapperRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!cropperWrapperRef.current) continue\n\n const imageElHeight = entry.contentRect.height\n const cropperWrapperHeight = cropperWrapperRef.current.clientHeight\n\n if (Math.ceil(imageElHeight) < Math.ceil(cropperWrapperHeight)) {\n setFullHeight(false)\n } else {\n setFullHeight(true)\n }\n }\n })\n resizeObserver.observe(imageRef.current)\n\n return () => {\n resizeObserver.disconnect()\n }\n }\n }, [imageRef])\n\n return (\n <div className=\"ob-cropper__container\">\n <CropContainer\n className=\"ob-cropper__cropper-wrapper\"\n height={cropperHeight}\n ref={cropperWrapperRef}\n >\n <ReactImageCrop\n crop={crop}\n aspect={outputAspectRatio}\n onChange={handleSetCrop}\n onComplete={handleCropComplete}\n disabled={disabled}\n className={clsx('ob-cropper__cropper', {\n 'ob-cropper__cropper-full-height': fullHeight,\n })}\n ruleOfThirds\n keepSelection\n >\n <img\n src={imgSrc}\n className=\"ob-cropper__image\"\n onLoad={handleLoadImage}\n ref={imageRef}\n />\n </ReactImageCrop>\n </CropContainer>\n </div>\n )\n}\n\nexport default memo(ImageCropper)\n\nexport const getAspectRatio = ({\n width,\n height,\n}: {\n width: number\n height: number\n}) => width / height\n\nconst createImage = (url: string): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const image = new Image()\n image.onload = () => {\n resolve(image)\n }\n image.onerror = (error) => {\n reject(error)\n }\n image.src = url\n return image\n })\n}\n\nexport const generateCroppedImageBlob = async ({\n croppedAreaPercent,\n imgSrc,\n size,\n fileType,\n}: {\n croppedAreaPercent: PercentCrop\n imgSrc: string\n /**\n * If provided, the cropped image will be resized to the given size. If not\n * provided, the cropped image will be the same size as the cropped portion of\n * the source image.\n */\n size?: {\n width: number\n height: number\n }\n fileType?: string\n}): Promise<Blob | null> => {\n if (!croppedAreaPercent || !imgSrc) {\n return null\n }\n // Source image/canvas\n const image = await createImage(imgSrc)\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n return null\n }\n canvas.width = image.width\n canvas.height = image.height\n ctx.drawImage(image, 0, 0)\n\n // Destination image/canvas\n const croppedCanvas = document.createElement('canvas')\n const croppedCtx = croppedCanvas.getContext('2d')\n if (!croppedCtx) {\n return null\n }\n\n const widthPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.width\n const heightPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.height\n\n const sourceXPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.x\n const sourceYPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.y\n\n croppedCanvas.width = size?.width ?? widthPercentAsPixels()\n croppedCanvas.height = size?.height ?? heightPercentAsPixels()\n\n // Draw the cropped source image onto the destination canvas\n croppedCtx.drawImage(\n canvas,\n // source x\n sourceXPercentAsPixels(),\n // source y\n sourceYPercentAsPixels(),\n // source width\n widthPercentAsPixels(),\n // source height\n heightPercentAsPixels(),\n // destination x\n 0,\n // destination y\n 0,\n // destination width\n croppedCanvas.width,\n // destination height\n croppedCanvas.height,\n )\n\n return new Promise((resolve) => {\n croppedCanvas.toBlob((file) => {\n resolve(file)\n }, fileType)\n })\n}\n"]}
package/dist/styles.css CHANGED
@@ -10206,3 +10206,243 @@ textarea:disabled {
10206
10206
  .ob-downloadable-files__error-pdf {
10207
10207
  padding-bottom: 1.5rem;
10208
10208
  }
10209
+
10210
+ @keyframes marching-ants {
10211
+ 0% {
10212
+ background-position: 0 0, 0 100%, 0 0, 100% 0;
10213
+ }
10214
+ 100% {
10215
+ background-position: 20px 0, -20px 100%, 0 -20px, 100% 20px;
10216
+ }
10217
+ }
10218
+ :root {
10219
+ --rc-drag-handle-size: 12px;
10220
+ --rc-drag-handle-mobile-size: 24px;
10221
+ --rc-drag-handle-bg-colour: rgba(0, 0, 0, 0.2);
10222
+ --rc-drag-bar-size: 6px;
10223
+ --rc-border-color: rgba(255, 255, 255, 0.7);
10224
+ --rc-focus-color: #0088ff;
10225
+ }
10226
+
10227
+ .ReactCrop {
10228
+ position: relative;
10229
+ display: inline-block;
10230
+ cursor: crosshair;
10231
+ max-width: 100%;
10232
+ }
10233
+ .ReactCrop *, .ReactCrop *::before, .ReactCrop *::after {
10234
+ box-sizing: border-box;
10235
+ }
10236
+ .ReactCrop--disabled, .ReactCrop--locked {
10237
+ cursor: inherit;
10238
+ }
10239
+ .ReactCrop__child-wrapper {
10240
+ overflow: hidden;
10241
+ max-height: inherit;
10242
+ }
10243
+ .ReactCrop__child-wrapper > img, .ReactCrop__child-wrapper > video {
10244
+ display: block;
10245
+ max-width: 100%;
10246
+ max-height: inherit;
10247
+ }
10248
+ .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > img, .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > video {
10249
+ touch-action: none;
10250
+ }
10251
+ .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection {
10252
+ touch-action: none;
10253
+ }
10254
+ .ReactCrop__crop-mask {
10255
+ position: absolute;
10256
+ top: 0;
10257
+ right: 0;
10258
+ bottom: 0;
10259
+ left: 0;
10260
+ pointer-events: none;
10261
+ width: calc(100% + 0.5px);
10262
+ height: calc(100% + 0.5px);
10263
+ }
10264
+ .ReactCrop__crop-selection {
10265
+ position: absolute;
10266
+ top: 0;
10267
+ left: 0;
10268
+ transform: translate3d(0, 0, 0);
10269
+ cursor: move;
10270
+ }
10271
+ .ReactCrop--disabled .ReactCrop__crop-selection {
10272
+ cursor: inherit;
10273
+ }
10274
+ .ReactCrop--circular-crop .ReactCrop__crop-selection {
10275
+ border-radius: 50%;
10276
+ }
10277
+ .ReactCrop--circular-crop .ReactCrop__crop-selection::after {
10278
+ pointer-events: none;
10279
+ content: "";
10280
+ position: absolute;
10281
+ top: -1px;
10282
+ right: -1px;
10283
+ bottom: -1px;
10284
+ left: -1px;
10285
+ border: 1px solid var(--rc-border-color);
10286
+ opacity: 0.3;
10287
+ }
10288
+ .ReactCrop--no-animate .ReactCrop__crop-selection {
10289
+ outline: 1px dashed white;
10290
+ }
10291
+ .ReactCrop__crop-selection:not(.ReactCrop--no-animate .ReactCrop__crop-selection) {
10292
+ animation: marching-ants 1s;
10293
+ background-image: linear-gradient(to right, #fff 50%, #444 50%), linear-gradient(to right, #fff 50%, #444 50%), linear-gradient(to bottom, #fff 50%, #444 50%), linear-gradient(to bottom, #fff 50%, #444 50%);
10294
+ background-size: 10px 1px, 10px 1px, 1px 10px, 1px 10px;
10295
+ background-position: 0 0, 0 100%, 0 0, 100% 0;
10296
+ background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
10297
+ color: #fff;
10298
+ animation-play-state: running;
10299
+ animation-timing-function: linear;
10300
+ animation-iteration-count: infinite;
10301
+ }
10302
+ .ReactCrop__crop-selection:focus {
10303
+ outline: 2px solid var(--rc-focus-color);
10304
+ outline-offset: -1px;
10305
+ }
10306
+ .ReactCrop--invisible-crop .ReactCrop__crop-mask, .ReactCrop--invisible-crop .ReactCrop__crop-selection {
10307
+ display: none;
10308
+ }
10309
+ .ReactCrop__rule-of-thirds-vt::before, .ReactCrop__rule-of-thirds-vt::after, .ReactCrop__rule-of-thirds-hz::before, .ReactCrop__rule-of-thirds-hz::after {
10310
+ content: "";
10311
+ display: block;
10312
+ position: absolute;
10313
+ background-color: rgba(255, 255, 255, 0.4);
10314
+ }
10315
+ .ReactCrop__rule-of-thirds-vt::before, .ReactCrop__rule-of-thirds-vt::after {
10316
+ width: 1px;
10317
+ height: 100%;
10318
+ }
10319
+ .ReactCrop__rule-of-thirds-vt::before {
10320
+ left: 33.3333%;
10321
+ left: 33.3333333333%;
10322
+ }
10323
+ .ReactCrop__rule-of-thirds-vt::after {
10324
+ left: 66.6666%;
10325
+ left: 66.6666666667%;
10326
+ }
10327
+ .ReactCrop__rule-of-thirds-hz::before, .ReactCrop__rule-of-thirds-hz::after {
10328
+ width: 100%;
10329
+ height: 1px;
10330
+ }
10331
+ .ReactCrop__rule-of-thirds-hz::before {
10332
+ top: 33.3333%;
10333
+ top: 33.3333333333%;
10334
+ }
10335
+ .ReactCrop__rule-of-thirds-hz::after {
10336
+ top: 66.6666%;
10337
+ top: 66.6666666667%;
10338
+ }
10339
+ .ReactCrop__drag-handle {
10340
+ position: absolute;
10341
+ width: var(--rc-drag-handle-size);
10342
+ height: var(--rc-drag-handle-size);
10343
+ background-color: var(--rc-drag-handle-bg-colour);
10344
+ border: 1px solid var(--rc-border-color);
10345
+ }
10346
+ .ReactCrop__drag-handle:focus {
10347
+ background: var(--rc-focus-color);
10348
+ }
10349
+ .ReactCrop .ord-nw {
10350
+ top: 0;
10351
+ left: 0;
10352
+ transform: translate(-50%, -50%);
10353
+ cursor: nw-resize;
10354
+ }
10355
+ .ReactCrop .ord-n {
10356
+ top: 0;
10357
+ left: 50%;
10358
+ transform: translate(-50%, -50%);
10359
+ cursor: n-resize;
10360
+ }
10361
+ .ReactCrop .ord-ne {
10362
+ top: 0;
10363
+ right: 0;
10364
+ transform: translate(50%, -50%);
10365
+ cursor: ne-resize;
10366
+ }
10367
+ .ReactCrop .ord-e {
10368
+ top: 50%;
10369
+ right: 0;
10370
+ transform: translate(50%, -50%);
10371
+ cursor: e-resize;
10372
+ }
10373
+ .ReactCrop .ord-se {
10374
+ bottom: 0;
10375
+ right: 0;
10376
+ transform: translate(50%, 50%);
10377
+ cursor: se-resize;
10378
+ }
10379
+ .ReactCrop .ord-s {
10380
+ bottom: 0;
10381
+ left: 50%;
10382
+ transform: translate(-50%, 50%);
10383
+ cursor: s-resize;
10384
+ }
10385
+ .ReactCrop .ord-sw {
10386
+ bottom: 0;
10387
+ left: 0;
10388
+ transform: translate(-50%, 50%);
10389
+ cursor: sw-resize;
10390
+ }
10391
+ .ReactCrop .ord-w {
10392
+ top: 50%;
10393
+ left: 0;
10394
+ transform: translate(-50%, -50%);
10395
+ cursor: w-resize;
10396
+ }
10397
+ .ReactCrop__disabled .ReactCrop__drag-handle {
10398
+ cursor: inherit;
10399
+ }
10400
+ .ReactCrop__drag-bar {
10401
+ position: absolute;
10402
+ }
10403
+ .ReactCrop__drag-bar.ord-n {
10404
+ top: 0;
10405
+ left: 0;
10406
+ width: 100%;
10407
+ height: var(--rc-drag-bar-size);
10408
+ transform: translateY(-50%);
10409
+ }
10410
+ .ReactCrop__drag-bar.ord-e {
10411
+ right: 0;
10412
+ top: 0;
10413
+ width: var(--rc-drag-bar-size);
10414
+ height: 100%;
10415
+ transform: translateX(50%);
10416
+ }
10417
+ .ReactCrop__drag-bar.ord-s {
10418
+ bottom: 0;
10419
+ left: 0;
10420
+ width: 100%;
10421
+ height: var(--rc-drag-bar-size);
10422
+ transform: translateY(50%);
10423
+ }
10424
+ .ReactCrop__drag-bar.ord-w {
10425
+ top: 0;
10426
+ left: 0;
10427
+ width: var(--rc-drag-bar-size);
10428
+ height: 100%;
10429
+ transform: translateX(-50%);
10430
+ }
10431
+ .ReactCrop--new-crop .ReactCrop__drag-bar, .ReactCrop--new-crop .ReactCrop__drag-handle, .ReactCrop--fixed-aspect .ReactCrop__drag-bar {
10432
+ display: none;
10433
+ }
10434
+ .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n, .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e, .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s, .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w {
10435
+ display: none;
10436
+ }
10437
+ @media (pointer: coarse) {
10438
+ .ReactCrop .ord-n,
10439
+ .ReactCrop .ord-e,
10440
+ .ReactCrop .ord-s,
10441
+ .ReactCrop .ord-w {
10442
+ display: none;
10443
+ }
10444
+ .ReactCrop__drag-handle {
10445
+ width: var(--rc-drag-handle-mobile-size);
10446
+ height: var(--rc-drag-handle-mobile-size);
10447
+ }
10448
+ }
package/dist/styles.scss CHANGED
@@ -151,3 +151,4 @@ $section-padding-mobile: $section-padding-mobile-y $section-padding-mobile-x;
151
151
  //
152
152
  // Third Party
153
153
  //
154
+ @import 'react-image-crop/src/ReactCrop.scss';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/apps-react",
3
3
  "description": "Helper functions for OneBlink apps in ReactJS.",
4
- "version": "8.12.0-beta.7",
4
+ "version": "8.12.0-beta.9",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/apps-react/issues"