@equinor/ioc-common-frontend 20.0.5 → 20.0.7
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/build/{ImageComponent-swu51ub3.js → ImageComponent-4PmjQ6KR.js} +1 -1
- package/build/{ImageComponent-CE3CS8Uc.cjs → ImageComponent-BUgb8cy3.cjs} +1 -1
- package/build/{index-Bhq1f3lQ.js → index-6xFPb52P.js} +4 -4
- package/build/{index-CdpAjXus.cjs → index-BaY_UwRI.cjs} +85 -85
- package/build/index.esm.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as te, o as z, _ as x, $ as re } from "./index-
|
|
1
|
+
import { s as te, o as z, _ as x, $ as re } from "./index-6xFPb52P.js";
|
|
2
2
|
import { jsx as m, Fragment as ne } from "react/jsx-runtime";
|
|
3
3
|
import { $getSelection as E, $isNodeSelection as d, $createNodeSelection as ae, $setSelection as K, $getNodeByKey as k, createCommand as oe, $isRangeSelection as ie, mergeRegister as se, SELECTION_CHANGE_COMMAND as ue, COMMAND_PRIORITY_LOW as u, CLICK_COMMAND as le, DRAGSTART_COMMAND as ce, KEY_DELETE_COMMAND as de, KEY_BACKSPACE_COMMAND as he, KEY_ENTER_COMMAND as me, KEY_ESCAPE_COMMAND as ge } from "lexical";
|
|
4
4
|
import { useState as G, useEffect as P, useCallback as h, useRef as L, Suspense as fe } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./ImageComponent.css');var s=require("./index-
|
|
1
|
+
"use strict";require('./ImageComponent.css');var s=require("./index-BaY_UwRI.cjs"),d=require("react/jsx-runtime"),e=require("lexical"),a=require("react");function Y(r,M){return r.getEditorState().read(()=>{const f=e.$getNodeByKey(M);return f!==null&&f.isSelected()})}s.styleInject("");var p=new Set,$=e.createCommand("RIGHT_CLICK_IMAGE_COMMAND");function B(r){var M=r.altText,f=r.className,v=r.imageRef,N=r.src,R=r.width,A=r.height,O=r.maxWidth,m=r.onError;return(function(c){if(!p.has(c))throw new Promise(function(S){var _=new Image;_.src=c,_.onload=function(){p.add(c),S(null)},_.onerror=function(){p.add(c)}})})(N),d.jsx("img",{className:f||void 0,src:N,alt:M,ref:v,style:{height:A,maxWidth:O,width:R},onError:m,draggable:"false"})}function U(){return d.jsx("img",{src:"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22%203H2v18h20v-2h-2v-2h2v-2h-2v-2h2v-2h-2V9h2V7h-2V5h2V3zm-2%204v2h-2v2h2v2h-2v2h2v2h-2v2H4V5h14v2h2zm-6%202h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v-2h-2V9zM6%207h2v2H6V7z'%20fill='%23000000'/%3e%3c/svg%3e",style:{height:200,opacity:.2,width:200},draggable:"false"})}exports.RIGHT_CLICK_IMAGE_COMMAND=$,exports.default=function(r){var M=r.src,f=r.altText,v=r.nodeKey,N=r.width,R=r.height,A=r.maxWidth,O=r.showCaption,m=r.caption,c=a.useRef(null),S=a.useRef(null),_=(function(n){const[t]=s.o(),[g,h]=a.useState(()=>Y(t,n));return a.useEffect(()=>{let o=!0;const u=t.registerUpdateListener(()=>{o&&h(Y(t,n))});return()=>{o=!1,u()}},[t,n]),[g,a.useCallback(o=>{t.update(()=>{let u=e.$getSelection();e.$isNodeSelection(u)||(u=e.$createNodeSelection(),e.$setSelection(u)),e.$isNodeSelection(u)&&(o?u.add(n):u.delete(n))})},[t,n]),a.useCallback(()=>{t.update(()=>{const o=e.$getSelection();e.$isNodeSelection(o)&&o.clear()})},[t])]})(v),E=s._slicedToArray(_,3),l=E[0],C=E[1],I=E[2],P=s.o(),i=s._slicedToArray(P,1)[0],G=a.useState(null),w=s._slicedToArray(G,2),L=w[0],j=w[1],y=a.useRef(null),V=a.useState(!1),b=s._slicedToArray(V,2),k=b[0],H=b[1],x=a.useCallback(function(n){if(l&&e.$isNodeSelection(e.$getSelection())){n.preventDefault();var t=e.$getNodeByKey(v);if(s.$isImageNode(t))return t?.remove(),!0}return!1},[l,v]),K=a.useCallback(function(n){var t=e.$getSelection(),g=S.current;if(l&&e.$isNodeSelection(t)&&t.getNodes().length===1){if(O)return e.$setSelection(null),n.preventDefault(),m.focus(),!0;if(g!==null&&g!==document.activeElement)return n.preventDefault(),g.focus(),!0}return!1},[m,l,O]),W=a.useCallback(function(n){return(y.current===m||S.current===n.target)&&(e.$setSelection(null),i.update(function(){C(!0);var t=i.getRootElement();t!==null&&t.focus()}),!0)},[m,i,C]),D=a.useCallback(function(n){var t=n;return t.target===c.current&&(t.shiftKey?C(!l):(I(),C(!0)),!0)},[l,C,I]),T=a.useCallback(function(n){i.getEditorState().read(function(){var t=e.$getSelection();n.target.tagName==="IMG"&&e.$isRangeSelection(t)&&t.getNodes().length===1&&i.dispatchCommand($,n)})},[i]);a.useEffect(function(){var n=!0,t=i.getRootElement(),g=e.mergeRegister(i.registerUpdateListener(function(h){var o=h.editorState;n&&j(o.read(function(){return e.$getSelection()}))}),i.registerCommand(e.SELECTION_CHANGE_COMMAND,function(h,o){return y.current=o,!1},e.COMMAND_PRIORITY_LOW),i.registerCommand(e.CLICK_COMMAND,D,e.COMMAND_PRIORITY_LOW),i.registerCommand($,D,e.COMMAND_PRIORITY_LOW),i.registerCommand(e.DRAGSTART_COMMAND,function(h){return h.target===c.current&&(h.preventDefault(),!0)},e.COMMAND_PRIORITY_LOW),i.registerCommand(e.KEY_DELETE_COMMAND,x,e.COMMAND_PRIORITY_LOW),i.registerCommand(e.KEY_BACKSPACE_COMMAND,x,e.COMMAND_PRIORITY_LOW),i.registerCommand(e.KEY_ENTER_COMMAND,K,e.COMMAND_PRIORITY_LOW),i.registerCommand(e.KEY_ESCAPE_COMMAND,W,e.COMMAND_PRIORITY_LOW));return t?.addEventListener("contextmenu",T),function(){n=!1,g(),t?.removeEventListener("contextmenu",T)}},[I,i,l,v,x,K,W,D,T,C]);var q=l&&e.$isNodeSelection(L),z=l;return d.jsx(a.Suspense,{fallback:null,children:d.jsx(d.Fragment,{children:d.jsx("div",{draggable:q,children:k?d.jsx(U,{}):d.jsx(B,{className:z?"focused ".concat(e.$isNodeSelection(L)?"draggable":""):null,src:M,altText:f,imageRef:c,width:N,height:R,maxWidth:A,onError:function(){return H(!0)}})})})})};
|
|
@@ -10666,7 +10666,7 @@ var Vxe = function(e) {
|
|
|
10666
10666
|
}
|
|
10667
10667
|
return e;
|
|
10668
10668
|
}, Bxe = function(e) {
|
|
10669
|
-
var t = e.items, n = e.index, r = e.style, o = t[n], i = Object.assign(Object.assign({}, r), {
|
|
10669
|
+
var t = e.items, n = e.index, r = e.style, o = t[n], i = Object.assign(Object.assign({}, r), { width: "100%", boxSizing: "border-box" });
|
|
10670
10670
|
if (o.type === "groupHeader") return k("div", { style: i, children: o.element }, o.key);
|
|
10671
10671
|
var a = o.element.props;
|
|
10672
10672
|
return Ds(o.element, { key: o.key, style: Object.assign(Object.assign({}, a.style || {}), i) });
|
|
@@ -10695,7 +10695,7 @@ var Vxe = function(e) {
|
|
|
10695
10695
|
for (var m = 0, g = 0; g < Math.min(c, 8); g++) m += f(g);
|
|
10696
10696
|
return Math.min(m + 16, 400);
|
|
10697
10697
|
}, [c, f]);
|
|
10698
|
-
return k("div", Object.assign({ ref: t }, s, { style: Object.assign(Object.assign({}, (n = s.style) !== null && n !== void 0 ? n : {}), { overflow: "hidden", maxHeight: "none" }), children: k(Fxe, { rowProps: { items: l }, defaultHeight: h, rowComponent: Bxe, rowHeight: f, overscanCount: 12, rowCount: c, style: { height: h, minHeight: p } }) }));
|
|
10698
|
+
return k("div", Object.assign({ ref: t }, s, { style: Object.assign(Object.assign({}, (n = s.style) !== null && n !== void 0 ? n : {}), { overflow: "hidden", maxHeight: "none" }), children: k(Fxe, { rowProps: { items: l }, defaultHeight: h, rowComponent: Bxe, rowHeight: f, overscanCount: 12, rowCount: c, style: { height: h, minHeight: p, paddingTop: 8, paddingBottom: 8 } }) }));
|
|
10699
10699
|
});
|
|
10700
10700
|
function QQ(e) {
|
|
10701
10701
|
var t, n, r, o = e.startIcon, i = e.fullWidth, a = e.width, s = e.height, l = e.error, c = e.showAsMonospaced, d = e.virtualizedOptionsList, p = e.showMultipleAsChipsInInputField, f = p === void 0 || p, h = e.inputProps, m = e.sx, g = e.disabled, v = e.optionWidth, b = e.optionHeight, x = e.groupHeaderHeight, S = e.noOptionsText, C = e.showInputTooltip, w = xt(e, ["startIcon", "fullWidth", "width", "height", "error", "showAsMonospaced", "virtualizedOptionsList", "showMultipleAsChipsInInputField", "inputProps", "sx", "disabled", "optionWidth", "optionHeight", "groupHeaderHeight", "noOptionsText", "showInputTooltip"]);
|
|
@@ -11038,7 +11038,7 @@ var qje = function(e) {
|
|
|
11038
11038
|
}, $selected: d, tabIndex: 0, $disabled: a, children: [k(vwe, { id: "dot", children: k(gwe, {}) }), k(bwe, { children: k(xwe, {}) }), k("input", { "data-testid": "inputField", type: "file", id: "attachmentInput", ref: l, onChange: function(f) {
|
|
11039
11039
|
var h = f.target, m = Array.from(h.files);
|
|
11040
11040
|
i(m);
|
|
11041
|
-
}, multiple: !0, accept: s ?? "image/*,application/pdf,.eml,.msg,text/plain,.xlsx", style: { display: "none" }, disabled: a }), oe(ywe, { id: "action", children: [k(Co, { style: { height: "36px", width: "110px" }, "data-testid": "UploadAttachButton", buttonstyle: "outlined", onClick: function() {
|
|
11041
|
+
}, multiple: !0, accept: s ?? "image/*,application/pdf,.eml,.msg,text/plain,.xlsx,.xls,.docx,.doc,.csv,.ppt,.pptx", style: { display: "none" }, disabled: a }), oe(ywe, { id: "action", children: [k(Co, { style: { height: "36px", width: "110px" }, "data-testid": "UploadAttachButton", buttonstyle: "outlined", onClick: function() {
|
|
11042
11042
|
var f = l?.current;
|
|
11043
11043
|
f?.click();
|
|
11044
11044
|
}, disabled: a, children: n }), k(Jo, { htmlColor: W.mossGreen.tint[66], style: { width: "24px", height: "24px" }, children: k("path", { d: ube }) })] })] })] }) });
|
|
@@ -18604,7 +18604,7 @@ function $ee() {
|
|
|
18604
18604
|
})();
|
|
18605
18605
|
}
|
|
18606
18606
|
var YMe = L.lazy(function() {
|
|
18607
|
-
return import("./ImageComponent-
|
|
18607
|
+
return import("./ImageComponent-4PmjQ6KR.js");
|
|
18608
18608
|
});
|
|
18609
18609
|
function GMe(e) {
|
|
18610
18610
|
var t = e;
|