@coorpacademy/components 11.11.13-alpha.4 → 11.11.13
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/es/atom/range/handle.d.ts.map +1 -1
- package/es/atom/range/handle.js +4 -1
- package/es/atom/range/handle.js.map +1 -1
- package/es/organism/mooc-header/style.css +0 -1
- package/es/variables/fonts.css +0 -4
- package/lib/atom/range/handle.d.ts.map +1 -1
- package/lib/atom/range/handle.js +4 -1
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/organism/mooc-header/style.css +0 -1
- package/lib/variables/fonts.css +0 -4
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../src/atom/range/handle.js"],"names":[],"mappings":";AA6BA,
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../src/atom/range/handle.js"],"names":[],"mappings":";AA6BA,qEAwCC"}
|
package/es/atom/range/handle.js
CHANGED
|
@@ -44,7 +44,10 @@ const Handle = (props, legacyContext) => {
|
|
|
44
44
|
HammerForTesting
|
|
45
45
|
} = props;
|
|
46
46
|
const handle = useRef();
|
|
47
|
-
const hammer = useMemo(() =>
|
|
47
|
+
const hammer = useMemo(() => {
|
|
48
|
+
return HammerForTesting || handle.current && new Hammer(handle.current); // (we need to mount Hammer when handle.current is rendered and ready)
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
+
}, [handle.current, HammerForTesting]);
|
|
48
51
|
useEffect(() => {
|
|
49
52
|
if (!hammer) return;
|
|
50
53
|
hammer.on('panstart', onPanStart);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","names":["React","useEffect","useMemo","useRef","PropTypes","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","NoopHammer","constructor","on","stop","destroy","Hammer","window","require","Handle","props","legacyContext","skin","primaryColor","backgroundColor","onPanStart","onPanEnd","onPan","HammerForTesting","handle","hammer","current","wrapper","boxShadow","default","propTypes","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/atom/range/handle.js"],"sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React, {useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nclass NoopHammer {\n constructor() {}\n\n // eslint-disable-next-line class-methods-use-this\n on() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n stop() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n destroy() {\n return;\n }\n}\n\nconst Hammer = // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? /* istanbul ignore next */ require('hammerjs') : NoopHammer;\n\nconst Handle = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n const {onPanStart = noop, onPanEnd = noop, onPan = noop, HammerForTesting} = props;\n\n const handle = useRef();\n const hammer = useMemo(
|
|
1
|
+
{"version":3,"file":"handle.js","names":["React","useEffect","useMemo","useRef","PropTypes","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","NoopHammer","constructor","on","stop","destroy","Hammer","window","require","Handle","props","legacyContext","skin","primaryColor","backgroundColor","onPanStart","onPanEnd","onPan","HammerForTesting","handle","hammer","current","wrapper","boxShadow","default","propTypes","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/atom/range/handle.js"],"sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React, {useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nclass NoopHammer {\n constructor() {}\n\n // eslint-disable-next-line class-methods-use-this\n on() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n stop() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n destroy() {\n return;\n }\n}\n\nconst Hammer = // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? /* istanbul ignore next */ require('hammerjs') : NoopHammer;\n\nconst Handle = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n const {onPanStart = noop, onPanEnd = noop, onPan = noop, HammerForTesting} = props;\n\n const handle = useRef();\n\n const hammer = useMemo(() => {\n return HammerForTesting || (handle.current && new Hammer(handle.current));\n // (we need to mount Hammer when handle.current is rendered and ready)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handle.current, HammerForTesting]);\n\n useEffect(() => {\n if (!hammer) return;\n hammer.on('panstart', onPanStart);\n hammer.on('panend', onPanEnd);\n\n hammer.on('panleft panright', onPan);\n\n return () => {\n hammer.stop();\n hammer.destroy();\n };\n }, [hammer, onPanStart, onPanEnd, onPan]);\n\n return (\n <div className={style.wrapper} data-testid=\"handle-wrapper\">\n <div\n style={{\n backgroundColor,\n boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`\n }}\n className={style.default}\n ref={handle}\n data-name={'handle'}\n />\n </div>\n );\n};\n\nHandle.propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func,\n HammerForTesting: PropTypes.shape({\n on: PropTypes.func,\n destroy: PropTypes.func,\n stop: PropTypes.func\n })\n};\n\nHandle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default Handle;\n"],"mappings":";;AACA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,OAA1B,EAAmCC,MAAnC,QAAgD,OAAhD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,S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MACAgB,MAAM,CAACf,OAAP;IACD,CAHD;EAID,CAXQ,EAWN,CAACe,MAAD,EAASL,UAAT,EAAqBC,QAArB,EAA+BC,KAA/B,CAXM,CAAT;EAaA,oBACE;IAAK,SAAS,EAAEjB,KAAK,CAACsB,OAAtB;IAA+B,eAAY;EAA3C,gBACE;IACE,KAAK,EAAE;MACLR,eADK;MAELS,SAAS,EAAG,gBAAexB,4BAA4B,CAACc,YAAD,CAAe;IAFjE,CADT;IAKE,SAAS,EAAEb,KAAK,CAACwB,OALnB;IAME,GAAG,EAAEL,MANP;IAOE,aAAW;EAPb,EADF,CADF;AAaD,CAxCD;;AA0CAV,MAAM,CAACgB,SAAP,2CAAmB;EACjBR,KAAK,EAAErB,SAAS,CAAC8B,IADA;EAEjBX,UAAU,EAAEnB,SAAS,CAAC8B,IAFL;EAGjBV,QAAQ,EAAEpB,SAAS,CAAC8B,IAHH;EAIjBR,gBAAgB,EAAEtB,SAAS,CAAC+B,KAAV,CAAgB;IAChCxB,EAAE,EAAEP,SAAS,CAAC8B,IADkB;IAEhCrB,OAAO,EAAET,SAAS,CAAC8B,IAFa;IAGhCtB,IAAI,EAAER,SAAS,CAAC8B;EAHgB,CAAhB;AAJD,CAAnB;AAWAjB,MAAM,CAACmB,YAAP,GAAsB;EACpBhB,IAAI,EAAEf,QAAQ,CAACgC,iBAAT,CAA2BjB;AADb,CAAtB;AAIA,eAAeH,MAAf"}
|
package/es/variables/fonts.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../src/atom/range/handle.js"],"names":[],"mappings":";AA6BA,
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../src/atom/range/handle.js"],"names":[],"mappings":";AA6BA,qEAwCC"}
|
package/lib/atom/range/handle.js
CHANGED
|
@@ -59,7 +59,10 @@ const Handle = (props, legacyContext) => {
|
|
|
59
59
|
HammerForTesting
|
|
60
60
|
} = props;
|
|
61
61
|
const handle = (0, _react.useRef)();
|
|
62
|
-
const hammer = (0, _react.useMemo)(() =>
|
|
62
|
+
const hammer = (0, _react.useMemo)(() => {
|
|
63
|
+
return HammerForTesting || handle.current && new Hammer(handle.current); // (we need to mount Hammer when handle.current is rendered and ready)
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
}, [handle.current, HammerForTesting]);
|
|
63
66
|
(0, _react.useEffect)(() => {
|
|
64
67
|
if (!hammer) return;
|
|
65
68
|
hammer.on('panstart', onPanStart);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","names":["NoopHammer","constructor","on","stop","destroy","Hammer","window","require","Handle","props","legacyContext","skin","GetSkinFromContext","primaryColor","backgroundColor","onPanStart","onPanEnd","onPan","HammerForTesting","handle","useRef","hammer","useMemo","current","useEffect","style","wrapper","boxShadow","getShadowBoxColorFromPrimary","default","propTypes","PropTypes","func","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/range/handle.js"],"sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React, {useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nclass NoopHammer {\n constructor() {}\n\n // eslint-disable-next-line class-methods-use-this\n on() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n stop() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n destroy() {\n return;\n }\n}\n\nconst Hammer = // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? /* istanbul ignore next */ require('hammerjs') : NoopHammer;\n\nconst Handle = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n const {onPanStart = noop, onPanEnd = noop, onPan = noop, HammerForTesting} = props;\n\n const handle = useRef();\n const hammer = useMemo(
|
|
1
|
+
{"version":3,"file":"handle.js","names":["NoopHammer","constructor","on","stop","destroy","Hammer","window","require","Handle","props","legacyContext","skin","GetSkinFromContext","primaryColor","backgroundColor","onPanStart","onPanEnd","onPan","HammerForTesting","handle","useRef","hammer","useMemo","current","useEffect","style","wrapper","boxShadow","getShadowBoxColorFromPrimary","default","propTypes","PropTypes","func","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/range/handle.js"],"sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React, {useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nclass NoopHammer {\n constructor() {}\n\n // eslint-disable-next-line class-methods-use-this\n on() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n stop() {\n return;\n }\n\n // eslint-disable-next-line class-methods-use-this\n destroy() {\n return;\n }\n}\n\nconst Hammer = // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? /* istanbul ignore next */ require('hammerjs') : NoopHammer;\n\nconst Handle = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n const {onPanStart = noop, onPanEnd = noop, onPan = noop, HammerForTesting} = props;\n\n const handle = useRef();\n\n const hammer = useMemo(() => {\n return HammerForTesting || (handle.current && new Hammer(handle.current));\n // (we need to mount Hammer when handle.current is rendered and ready)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handle.current, HammerForTesting]);\n\n useEffect(() => {\n if (!hammer) return;\n hammer.on('panstart', onPanStart);\n hammer.on('panend', onPanEnd);\n\n hammer.on('panleft panright', onPan);\n\n return () => {\n hammer.stop();\n hammer.destroy();\n };\n }, [hammer, onPanStart, onPanEnd, onPan]);\n\n return (\n <div className={style.wrapper} data-testid=\"handle-wrapper\">\n <div\n style={{\n backgroundColor,\n boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`\n }}\n className={style.default}\n ref={handle}\n data-name={'handle'}\n />\n </div>\n );\n};\n\nHandle.propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func,\n HammerForTesting: PropTypes.shape({\n on: PropTypes.func,\n destroy: PropTypes.func,\n stop: PropTypes.func\n })\n};\n\nHandle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default Handle;\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,UAAN,CAAiB;EACfC,WAAW,GAAG,CAAE,CADD,CAGf;;;EACAC,EAAE,GAAG;IACH;EACD,CANc,CAQf;;;EACAC,IAAI,GAAG;IACL;EACD,CAXc,CAaf;;;EACAC,OAAO,GAAG;IACR;EACD;;AAhBc;;AAmBjB,MAAMC,MAAM,GAAG;AACb,OAAOC,MAAP,KAAkB,WAAlB;AAAgC;AAA2BC,OAAO,CAAC,UAAD,CAAlE,GAAiFP,UADnF;;AAGA,MAAMQ,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAMC,IAAI,GAAG,IAAAC,4BAAA,EAAmBF,aAAnB,CAAb;EACA,MAAMG,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAArB;EACA,MAAMG,eAAe,GAAGD,YAAxB;EACA,MAAM;IAACE,UAAU,iBAAX;IAAoBC,QAAQ,iBAA5B;IAAqCC,KAAK,iBAA1C;IAAmDC;EAAnD,IAAuET,KAA7E;EAEA,MAAMU,MAAM,GAAG,IAAAC,aAAA,GAAf;EAEA,MAAMC,MAAM,GAAG,IAAAC,cAAA,EAAQ,MAAM;IAC3B,OAAOJ,gBAAgB,IAAKC,MAAM,CAACI,OAAP,IAAkB,IAAIlB,MAAJ,CAAWc,MAAM,CAACI,OAAlB,CAA9C,CAD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H,M"}
|
package/lib/variables/fonts.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ignore_dirs":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.11.13
|
|
3
|
+
"version": "11.11.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -165,5 +165,5 @@
|
|
|
165
165
|
"last 2 versions",
|
|
166
166
|
"IE 11"
|
|
167
167
|
],
|
|
168
|
-
"gitHead": "
|
|
168
|
+
"gitHead": "4849c0ed052d6d37918c67e412642399d7b70d6e"
|
|
169
169
|
}
|