@cds/core 6.3.0 → 6.3.2
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,2 +1,2 @@
|
|
|
1
|
-
import{getOffesetDifference as t}from"../utils/math.js";function e(){return t=>t.addInitializer((t=>new s(t)))}class s{constructor(t){this.host=t,this.moveHandler=this.move.bind(this),this.endHandler=this.end.bind(this),this.host.addController(this)}async hostConnected(){await this.host.updateComplete,this.host.addEventListener("pointerdown",(t=>this.start(t)),{passive:!0})}start(t){t.
|
|
1
|
+
import{getOffesetDifference as t}from"../utils/math.js";function e(){return t=>t.addInitializer((t=>new s(t)))}class s{constructor(t){this.host=t,this.moveHandler=this.move.bind(this),this.endHandler=this.end.bind(this),this.host.addController(this)}async hostConnected(){await this.host.updateComplete,this.host.addEventListener("pointerdown",(t=>this.start(t)),{passive:!0})}start(t){t.composedPath().find((t=>t===this.host))&&(this.startPosition={x:t.clientX,y:t.clientY},document.addEventListener("pointerup",this.endHandler,{passive:!0}),document.addEventListener("pointermove",this.moveHandler,{passive:!0}),this.host.dispatchEvent(new CustomEvent("cdsTouchStart",{detail:{...this.startPosition}})))}end(t){if(this.startPosition){const e=this.getCoordinates(t);document.removeEventListener("pointerup",this.endHandler,!1),document.removeEventListener("pointermove",this.moveHandler,!1),this.host.dispatchEvent(new CustomEvent("cdsTouchEnd",{detail:e}))}}move(t){requestAnimationFrame((()=>{const e=this.getCoordinates(t);this.startPosition={x:t.clientX,y:t.clientY},this.host.dispatchEvent(new CustomEvent("cdsTouchMove",{detail:e}))}))}getCoordinates(e){return{x:e.clientX,y:e.clientY,offsetX:t(this.startPosition.x,e.clientX),offsetY:t(this.startPosition.y,e.clientY)}}}export{s as TouchController,e as touch};
|
|
2
2
|
//# sourceMappingURL=touch.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"touch.controller.js","sources":["../../../../src/internal/controllers/touch.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { getOffesetDifference } from '../utils/math.js';\n/**\n * @internal Provides all nessesary events for basic touch gestures\n *\n * @event cdsTouchStart\n * @event cdsTouchMove\n * @event cdsTouchEnd\n */\nexport function touch() {\n return (target) => target.addInitializer((instance) => new TouchController(instance));\n}\nexport class TouchController {\n constructor(host) {\n this.host = host;\n this.moveHandler = this.move.bind(this);\n this.endHandler = this.end.bind(this);\n this.host.addController(this);\n }\n async hostConnected() {\n await this.host.updateComplete;\n this.host.addEventListener('pointerdown', (e) => this.start(e), { passive: true });\n }\n start(e) {\n if (e.
|
|
1
|
+
{"version":3,"file":"touch.controller.js","sources":["../../../../src/internal/controllers/touch.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { getOffesetDifference } from '../utils/math.js';\n/**\n * @internal Provides all nessesary events for basic touch gestures\n *\n * @event cdsTouchStart\n * @event cdsTouchMove\n * @event cdsTouchEnd\n */\nexport function touch() {\n return (target) => target.addInitializer((instance) => new TouchController(instance));\n}\nexport class TouchController {\n constructor(host) {\n this.host = host;\n this.moveHandler = this.move.bind(this);\n this.endHandler = this.end.bind(this);\n this.host.addController(this);\n }\n async hostConnected() {\n await this.host.updateComplete;\n this.host.addEventListener('pointerdown', (e) => this.start(e), { passive: true });\n }\n start(e) {\n if (e.composedPath().find((el) => el === this.host)) {\n this.startPosition = { x: e.clientX, y: e.clientY };\n document.addEventListener('pointerup', this.endHandler, { passive: true });\n document.addEventListener('pointermove', this.moveHandler, { passive: true });\n this.host.dispatchEvent(new CustomEvent('cdsTouchStart', { detail: { ...this.startPosition } }));\n }\n }\n end(e) {\n if (this.startPosition) {\n const detail = this.getCoordinates(e);\n document.removeEventListener('pointerup', this.endHandler, false);\n document.removeEventListener('pointermove', this.moveHandler, false);\n this.host.dispatchEvent(new CustomEvent('cdsTouchEnd', { detail }));\n }\n }\n move(e) {\n requestAnimationFrame(() => {\n const detail = this.getCoordinates(e);\n this.startPosition = { x: e.clientX, y: e.clientY };\n this.host.dispatchEvent(new CustomEvent('cdsTouchMove', { detail }));\n });\n }\n getCoordinates(e) {\n return {\n x: e.clientX,\n y: e.clientY,\n offsetX: getOffesetDifference(this.startPosition.x, e.clientX),\n offsetY: getOffesetDifference(this.startPosition.y, e.clientY),\n };\n }\n}\n"],"names":["touch","target","addInitializer","instance","TouchController","constructor","host","this","moveHandler","move","bind","endHandler","end","addController","async","updateComplete","addEventListener","e","start","passive","composedPath","find","el","startPosition","x","clientX","y","clientY","document","dispatchEvent","CustomEvent","detail","getCoordinates","removeEventListener","requestAnimationFrame","offsetX","getOffesetDifference","offsetY"],"mappings":"wDAaO,SAASA,IACZ,OAAQC,GAAWA,EAAOC,gBAAgBC,GAAa,IAAIC,EAAgBD,KAExE,MAAMC,EACTC,YAAYC,GACRC,KAAKD,KAAOA,EACZC,KAAKC,YAAcD,KAAKE,KAAKC,KAAKH,MAClCA,KAAKI,WAAaJ,KAAKK,IAAIF,KAAKH,MAChCA,KAAKD,KAAKO,cAAcN,MAE5BO,4BACUP,KAAKD,KAAKS,eAChBR,KAAKD,KAAKU,iBAAiB,eAAgBC,GAAMV,KAAKW,MAAMD,IAAI,CAAEE,SAAS,IAE/ED,MAAMD,GACEA,EAAEG,eAAeC,MAAMC,GAAOA,IAAOf,KAAKD,SAC1CC,KAAKgB,cAAgB,CAAEC,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,SAC1CC,SAASZ,iBAAiB,YAAaT,KAAKI,WAAY,CAAEQ,SAAS,IACnES,SAASZ,iBAAiB,cAAeT,KAAKC,YAAa,CAAEW,SAAS,IACtEZ,KAAKD,KAAKuB,cAAc,IAAIC,YAAY,gBAAiB,CAAEC,OAAQ,IAAKxB,KAAKgB,mBAGrFX,IAAIK,GACA,GAAIV,KAAKgB,cAAe,CACpB,MAAMQ,EAASxB,KAAKyB,eAAef,GACnCW,SAASK,oBAAoB,YAAa1B,KAAKI,YAAY,GAC3DiB,SAASK,oBAAoB,cAAe1B,KAAKC,aAAa,GAC9DD,KAAKD,KAAKuB,cAAc,IAAIC,YAAY,cAAe,CAAEC,OAAAA,MAGjEtB,KAAKQ,GACDiB,uBAAsB,KAClB,MAAMH,EAASxB,KAAKyB,eAAef,GACnCV,KAAKgB,cAAgB,CAAEC,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,SAC1CpB,KAAKD,KAAKuB,cAAc,IAAIC,YAAY,eAAgB,CAAEC,OAAAA,QAGlEC,eAAef,GACX,MAAO,CACHO,EAAGP,EAAEQ,QACLC,EAAGT,EAAEU,QACLQ,QAASC,EAAqB7B,KAAKgB,cAAcC,EAAGP,EAAEQ,SACtDY,QAASD,EAAqB7B,KAAKgB,cAAcG,EAAGT,EAAEU"}
|
package/internal/utils/global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.3.
|
|
1
|
+
import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.3.2";window.CDS._version.indexOf(e)<0&&(window.CDS._version.push(e),document.querySelector("body")?.setAttribute("cds-version",window.CDS._version.join(" "))),window.CDS._version.length>1&&r.warn("Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.")}(),window.CDS._isStateProxied||(window.CDS._isStateProxied=!0,window.CDS._state=new Proxy(window.CDS._state,{set:(e,n,o)=>{const t={key:n,prev:window.CDS._state[n],current:o};return e[n]=o,document.dispatchEvent(new CustomEvent("CDS_STATE_UPDATE",{detail:t})),!0}})))}function a(){return{versions:window.CDS._version,environment:window.CDS.environment,userAgent:navigator.userAgent,supports:window.CDS._supports,angularVersion:n(!1),angularJSVersion:o(!1),reactVersion:t(!1),vueVersion:i(!1),state:{...window.CDS._state,iconRegistry:Object.keys(window.CDS._state.iconRegistry),motionRegistry:Object.keys(window.CDS._state.motionRegistry),focusTrapRegistry:Object.keys(window.CDS._state.focusTrapItems.map((e=>e.focusTrapId)))}}}function d(){r.log(JSON.stringify(a(),null,2))}export{w as setupCDSGlobal};
|
|
2
2
|
//# sourceMappingURL=global.js.map
|
package/package.json
CHANGED
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"./forms": "./forms/index.js",
|
|
109
109
|
"./grid": "./grid/index.js",
|
|
110
110
|
"./icon": "./icon/index.js",
|
|
111
|
-
"
|
|
111
|
+
".": "./index.js",
|
|
112
112
|
"./input": "./input/index.js",
|
|
113
113
|
"./internal-components/close-button": "./internal-components/close-button/index.js",
|
|
114
114
|
"./internal-components/overlay": "./internal-components/overlay/index.js",
|
|
@@ -255,5 +255,5 @@
|
|
|
255
255
|
"./tokens/tokens.ios.swift": "./tokens/tokens.ios.swift",
|
|
256
256
|
"./tokens/tokens.android.xml": "./tokens/tokens.android.xml"
|
|
257
257
|
},
|
|
258
|
-
"version": "6.3.
|
|
258
|
+
"version": "6.3.2"
|
|
259
259
|
}
|
package/styles/theme.dark.css
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
--cds-global-typography-color-500: var(--cds-global-color-white);
|
|
8
8
|
--cds-global-typography-color-400: var(--cds-global-color-construction-100);
|
|
9
9
|
--cds-global-typography-color-300: var(--cds-global-color-construction-200);
|
|
10
|
-
--cds-global-typography-color-200: var(--cds-global-color-construction-
|
|
10
|
+
--cds-global-typography-color-200: var(--cds-global-color-construction-300);
|
|
11
11
|
--cds-global-typography-color-100: var(--cds-global-color-construction-900);
|
|
12
12
|
--cds-global-typography-link-color: var(--cds-global-color-blue-400);
|
|
13
13
|
--cds-global-typography-link-color-hover: var(--cds-global-color-blue-500);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[cds-theme~=dark]{--cds-global-typography-color-500:var(--cds-global-color-white);--cds-global-typography-color-400:var(--cds-global-color-construction-100);--cds-global-typography-color-300:var(--cds-global-color-construction-200);--cds-global-typography-color-200:var(--cds-global-color-construction-
|
|
1
|
+
[cds-theme~=dark]{--cds-global-typography-color-500:var(--cds-global-color-white);--cds-global-typography-color-400:var(--cds-global-color-construction-100);--cds-global-typography-color-300:var(--cds-global-color-construction-200);--cds-global-typography-color-200:var(--cds-global-color-construction-300);--cds-global-typography-color-100:var(--cds-global-color-construction-900);--cds-global-typography-link-color:var(--cds-global-color-blue-400);--cds-global-typography-link-color-hover:var(--cds-global-color-blue-500);--cds-global-typography-link-color-visited:var(--cds-global-color-lavender-300);--cds-global-typography-link-color-visited-hover:var(--cds-global-color-lavender-400);--cds-alias-object-app-background:var(--cds-global-color-construction-1000);--cds-alias-object-container-background:var(--cds-global-color-construction-900);--cds-alias-object-container-background-tint:var(--cds-global-color-construction-1000);--cds-alias-object-container-background-shade:var(--cds-global-color-construction-800);--cds-alias-object-container-border-color:var(--cds-global-color-black);--cds-alias-object-overlay-background:var(--cds-global-color-construction-900);--cds-alias-object-border-color:var(--cds-global-color-construction-500);--cds-alias-object-border-color-tint:var(--cds-global-color-construction-400);--cds-alias-object-border-color-shade:var(--cds-global-color-construction-600);--cds-alias-object-shadow-100:0 var(--cds-global-space-1) var(--cds-global-space-2) 0 var(--cds-alias-object-opacity-300);--cds-alias-object-shadow-200:0 var(--cds-global-space-1) var(--cds-global-space-2) 0 var(--cds-alias-object-opacity-200);--cds-alias-object-shadow-300:0 var(--cds-global-space-1) var(--cds-global-space-2) 0 var(--cds-alias-object-opacity-100);--cds-alias-object-interaction-color:var(--cds-global-color-construction-200);--cds-alias-object-interaction-color-hover:var(--cds-global-color-construction-50);--cds-alias-object-interaction-color-active:var(--cds-global-color-construction-100);--cds-alias-object-interaction-color-selected:var(--cds-global-color-construction-200);--cds-alias-object-interaction-color-disabled:var(--cds-global-color-construction-600);--cds-alias-object-interaction-background:var(--cds-global-color-construction-900);--cds-alias-object-interaction-background-hover:var(--cds-global-color-construction-700);--cds-alias-object-interaction-background-active:var(--cds-global-color-construction-800);--cds-alias-object-interaction-background-selected:var(--cds-global-color-construction-700);--cds-alias-object-interaction-background-disabled:var(--cds-global-color-construction-900);--cds-alias-object-interaction-background-highlight:var(--cds-global-color-blue-400);--cds-alias-status-tint:transparent;--cds-alias-status-info:var(--cds-global-color-blue-400);--cds-alias-status-info-tint:var(--cds-global-color-blue-700);--cds-alias-status-info-shade:var(--cds-global-color-blue-700);--cds-alias-status-success:var(--cds-global-color-green-500);--cds-alias-status-success-tint:var(--cds-global-color-green-700);--cds-alias-status-success-shade:var(--cds-global-color-green-700);--cds-alias-status-warning:var(--cds-global-color-ochre-400);--cds-alias-status-warning-tint:var(--cds-global-color-ochre-500);--cds-alias-status-warning-shade:var(--cds-global-color-ochre-500);--cds-alias-status-warning-dark:var(--cds-global-color-ochre-500);--cds-alias-status-danger:var(--cds-global-color-red-500);--cds-alias-status-danger-dark:var(--cds-global-color-red-800);--cds-alias-status-danger-tint:var(--cds-global-color-red-700);--cds-alias-status-danger-shade:var(--cds-global-color-red-700);--cds-alias-status-neutral:var(--cds-global-color-construction-300);--cds-alias-status-neutral-tint:var(--cds-global-color-construction-500);--cds-alias-status-neutral-shade:var(--cds-global-color-construction-500);--cds-alias-status-disabled:var(--cds-global-color-construction-600);--cds-alias-status-disabled-tint:var(--cds-global-color-construction-700);--cds-alias-status-disabled-shade:var(--cds-global-color-construction-900)}
|