davis-components 0.3.22 → 0.3.24
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/Draft-Dl1kOLk2.js +188 -0
- package/dist/Draft-Wqqg32aQ.cjs +1 -0
- package/dist/convertFromRawToDraftState-CPAO0G_O.js +9923 -0
- package/dist/convertFromRawToDraftState-DdH8TQYu.cjs +24 -0
- package/dist/{html-to-draftjs-DW_ab1Fq.cjs → html-to-draftjs-BTwBWuVO.cjs} +2 -2
- package/dist/{html-to-draftjs-CdhgrGtJ.js → html-to-draftjs-Dkkh3u_g.js} +26 -26
- package/dist/{immutable-YfnqQFMB.js → immutable-CNK-cZJX.js} +1 -1
- package/dist/{immutable-DdXXqq64.cjs → immutable-Ccf-NNPb.cjs} +1 -1
- package/dist/{main-BnKJi2yi.js → main-BSbjDNzk.js} +2 -2
- package/dist/{main-yx7mJC0u.js → main-BYnciTy0.js} +2071 -2066
- package/dist/main-DtpdOd3i.cjs +9 -0
- package/dist/main-X5EUVgm8.cjs +52 -0
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1 -1
- package/dist/{react-draft-wysiwyg-lVtJz2JS.js → react-draft-wysiwyg-Bzl21wNi.js} +4 -4
- package/dist/{react-draft-wysiwyg-BUqWP6JD.cjs → react-draft-wysiwyg-DWS8ehhN.cjs} +1 -1
- package/package.json +1 -1
- package/dist/Draft-Bj28OnIx.cjs +0 -1
- package/dist/Draft-Bu61ox8H.js +0 -11043
- package/dist/Draft-CAw1r6Gg.js +0 -26
- package/dist/Draft-d06Boox0.cjs +0 -24
- package/dist/main-BIpLT2ZY.cjs +0 -52
- package/dist/main-CcdaFdji.cjs +0 -9
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { g as D } from "./main-BYnciTy0.js";
|
|
2
|
+
import { f as m, U as h, D as S, i as B, C as d, e as E, a as _, g as M, b as C, c as w, d as b, h as k, j as T, k as K, R as O, l as U, K as I, A as F, S as j, m as A, n as P, B as x, o as L, p as N, q as V, E as q, r as H, s as $ } from "./convertFromRawToDraftState-CPAO0G_O.js";
|
|
3
|
+
function Y(n, t) {
|
|
4
|
+
for (var e = 0; e < t.length; e++) {
|
|
5
|
+
const a = t[e];
|
|
6
|
+
if (typeof a != "string" && !Array.isArray(a)) {
|
|
7
|
+
for (const r in a)
|
|
8
|
+
if (r !== "default" && !(r in n)) {
|
|
9
|
+
const o = Object.getOwnPropertyDescriptor(a, r);
|
|
10
|
+
o && Object.defineProperty(n, r, o.get ? o : {
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
get: () => a[r]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
18
|
+
}
|
|
19
|
+
var z = {}, v = h, J = m, G = function(t, e) {
|
|
20
|
+
return t === e;
|
|
21
|
+
}, Q = function(t) {
|
|
22
|
+
return !!t;
|
|
23
|
+
}, W = [];
|
|
24
|
+
function X(n, t, e) {
|
|
25
|
+
var a = [], r = t.map(function(o) {
|
|
26
|
+
return o.has(e);
|
|
27
|
+
}).toList();
|
|
28
|
+
return J(
|
|
29
|
+
r,
|
|
30
|
+
G,
|
|
31
|
+
// We only want to keep ranges with nonzero style values.
|
|
32
|
+
Q,
|
|
33
|
+
function(o, i) {
|
|
34
|
+
var l = n.getText();
|
|
35
|
+
a.push({
|
|
36
|
+
offset: v.strlen(l.slice(0, o)),
|
|
37
|
+
length: v.strlen(l.slice(o, i)),
|
|
38
|
+
style: e
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
), a;
|
|
42
|
+
}
|
|
43
|
+
function Z(n) {
|
|
44
|
+
var t = n.getCharacterList().map(function(a) {
|
|
45
|
+
return a.getStyle();
|
|
46
|
+
}).toList(), e = t.flatten().toSet().map(function(a) {
|
|
47
|
+
return X(n, t, a);
|
|
48
|
+
});
|
|
49
|
+
return Array.prototype.concat.apply(W, e.toJS());
|
|
50
|
+
}
|
|
51
|
+
var tt = Z;
|
|
52
|
+
function et(n) {
|
|
53
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
54
|
+
var e = arguments[t] != null ? arguments[t] : {}, a = Object.keys(e);
|
|
55
|
+
typeof Object.getOwnPropertySymbols == "function" && (a = a.concat(Object.getOwnPropertySymbols(e).filter(function(r) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
57
|
+
}))), a.forEach(function(r) {
|
|
58
|
+
at(n, r, e[r]);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
function at(n, t, e) {
|
|
64
|
+
return t in n ? Object.defineProperty(n, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = e, n;
|
|
65
|
+
}
|
|
66
|
+
var rt = d, nt = _, p = S, ot = E, it = tt, u = B, y = function(t, e) {
|
|
67
|
+
return {
|
|
68
|
+
key: t.getKey(),
|
|
69
|
+
text: t.getText(),
|
|
70
|
+
type: t.getType(),
|
|
71
|
+
depth: t.getDepth(),
|
|
72
|
+
inlineStyleRanges: it(t),
|
|
73
|
+
entityRanges: ot(t, e),
|
|
74
|
+
data: t.getData().toObject()
|
|
75
|
+
};
|
|
76
|
+
}, lt = function(t, e, a, r) {
|
|
77
|
+
if (t instanceof rt) {
|
|
78
|
+
a.push(y(t, e));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
t instanceof nt || (process.env.NODE_ENV !== "production" ? u(!1, "block is not a BlockNode") : u(!1));
|
|
82
|
+
var o = t.getParentKey(), i = r[t.getKey()] = et({}, y(t, e), {
|
|
83
|
+
children: []
|
|
84
|
+
});
|
|
85
|
+
if (o) {
|
|
86
|
+
r[o].children.push(i);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
a.push(i);
|
|
90
|
+
}, ct = function(t, e) {
|
|
91
|
+
var a = e.entityMap, r = [], o = {}, i = {}, l = 0;
|
|
92
|
+
return t.getBlockMap().forEach(function(c) {
|
|
93
|
+
c.findEntityRanges(function(f) {
|
|
94
|
+
return f.getEntity() !== null;
|
|
95
|
+
}, function(f) {
|
|
96
|
+
var g = c.getEntityAt(f), s = p.stringify(g);
|
|
97
|
+
i[s] || (i[s] = g, a[s] = "".concat(l), l++);
|
|
98
|
+
}), lt(c, a, r, o);
|
|
99
|
+
}), {
|
|
100
|
+
blocks: r,
|
|
101
|
+
entityMap: a
|
|
102
|
+
};
|
|
103
|
+
}, ft = function(t, e) {
|
|
104
|
+
var a = e.blocks, r = e.entityMap, o = {};
|
|
105
|
+
return Object.keys(r).forEach(function(i, l) {
|
|
106
|
+
var c = t.getEntity(p.unstringify(i));
|
|
107
|
+
o[l] = {
|
|
108
|
+
type: c.getType(),
|
|
109
|
+
mutability: c.getMutability(),
|
|
110
|
+
data: c.getData()
|
|
111
|
+
};
|
|
112
|
+
}), {
|
|
113
|
+
blocks: a,
|
|
114
|
+
entityMap: o
|
|
115
|
+
};
|
|
116
|
+
}, st = function(t) {
|
|
117
|
+
var e = {
|
|
118
|
+
entityMap: {},
|
|
119
|
+
blocks: []
|
|
120
|
+
};
|
|
121
|
+
return e = ct(t, e), e = ft(t, e), e;
|
|
122
|
+
}, gt = st, vt = M;
|
|
123
|
+
function ut(n) {
|
|
124
|
+
var t = vt(n), e = 0, a = 0, r = 0, o = 0;
|
|
125
|
+
if (t.length) {
|
|
126
|
+
if (t.length > 1 && t[0].width === 0) {
|
|
127
|
+
var i = t[1];
|
|
128
|
+
e = i.top, a = i.right, r = i.bottom, o = i.left;
|
|
129
|
+
} else {
|
|
130
|
+
var l = t[0];
|
|
131
|
+
e = l.top, a = l.right, r = l.bottom, o = l.left;
|
|
132
|
+
}
|
|
133
|
+
for (var c = 1; c < t.length; c++) {
|
|
134
|
+
var f = t[c];
|
|
135
|
+
f.height !== 0 && f.width !== 0 && (e = Math.min(e, f.top), a = Math.max(a, f.right), r = Math.max(r, f.bottom), o = Math.min(o, f.left));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
top: e,
|
|
140
|
+
right: a,
|
|
141
|
+
bottom: r,
|
|
142
|
+
left: o,
|
|
143
|
+
width: a - o,
|
|
144
|
+
height: r - e
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
var yt = ut, dt = yt;
|
|
148
|
+
function pt(n) {
|
|
149
|
+
var t = n.getSelection();
|
|
150
|
+
if (!t.rangeCount)
|
|
151
|
+
return null;
|
|
152
|
+
var e = t.getRangeAt(0), a = dt(e), r = a.top, o = a.right, i = a.bottom, l = a.left;
|
|
153
|
+
return r === 0 && o === 0 && i === 0 && l === 0 ? null : a;
|
|
154
|
+
}
|
|
155
|
+
var Rt = pt, Dt = F, mt = x, ht = P, St = V, Bt = d, Et = A, _t = K, Mt = T, Ct = $, wt = H, bt = N, kt = U, Tt = L, Kt = q, Ot = I, Ut = z, It = O, Ft = j, jt = gt, At = b, Pt = w, xt = C, Lt = Rt, Nt = k, Vt = {
|
|
156
|
+
Editor: Ct,
|
|
157
|
+
EditorBlock: wt,
|
|
158
|
+
EditorState: Kt,
|
|
159
|
+
CompositeDecorator: St,
|
|
160
|
+
Entity: bt,
|
|
161
|
+
EntityInstance: Tt,
|
|
162
|
+
BlockMapBuilder: mt,
|
|
163
|
+
CharacterMetadata: ht,
|
|
164
|
+
ContentBlock: Bt,
|
|
165
|
+
ContentState: Et,
|
|
166
|
+
RawDraftContentState: Ut,
|
|
167
|
+
SelectionState: Ft,
|
|
168
|
+
AtomicBlockUtils: Dt,
|
|
169
|
+
KeyBindingUtil: Ot,
|
|
170
|
+
Modifier: kt,
|
|
171
|
+
RichUtils: It,
|
|
172
|
+
DefaultDraftBlockRenderMap: _t,
|
|
173
|
+
DefaultDraftInlineStyle: Mt,
|
|
174
|
+
convertFromHTML: Nt,
|
|
175
|
+
convertFromRaw: At,
|
|
176
|
+
convertToRaw: jt,
|
|
177
|
+
genKey: Pt,
|
|
178
|
+
getDefaultKeyBinding: xt,
|
|
179
|
+
getVisibleSelectionRect: Lt
|
|
180
|
+
}, R = Vt;
|
|
181
|
+
const qt = /* @__PURE__ */ D(R), Yt = /* @__PURE__ */ Y({
|
|
182
|
+
__proto__: null,
|
|
183
|
+
default: qt
|
|
184
|
+
}, [R]);
|
|
185
|
+
export {
|
|
186
|
+
Yt as D,
|
|
187
|
+
R as a
|
|
188
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const D=require("./main-X5EUVgm8.cjs"),a=require("./convertFromRawToDraftState-DdH8TQYu.cjs");function m(o,t){for(var e=0;e<t.length;e++){const r=t[e];if(typeof r!="string"&&!Array.isArray(r)){for(const n in r)if(n!=="default"&&!(n in o)){const i=Object.getOwnPropertyDescriptor(r,n);i&&Object.defineProperty(o,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var h={},y=a.UnicodeUtils_1,S=a.findRangesImmutable_1,B=function(t,e){return t===e},E=function(t){return!!t},_=[];function M(o,t,e){var r=[],n=t.map(function(i){return i.has(e)}).toList();return S(n,B,E,function(i,c){var l=o.getText();r.push({offset:y.strlen(l.slice(0,i)),length:y.strlen(l.slice(i,c)),style:e})}),r}function C(o){var t=o.getCharacterList().map(function(r){return r.getStyle()}).toList(),e=t.flatten().toSet().map(function(r){return M(o,t,r)});return Array.prototype.concat.apply(_,e.toJS())}var w=C;function b(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},r=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.forEach(function(n){T(o,n,e[n])})}return o}function T(o,t,e){return t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}var k=a.ContentBlock_1,K=a.ContentBlockNode_1,R=a.DraftStringKey_1,O=a.encodeEntityRanges_1,F=w,d=a.invariant_1,p=function(t,e){return{key:t.getKey(),text:t.getText(),type:t.getType(),depth:t.getDepth(),inlineStyleRanges:F(t),entityRanges:O(t,e),data:t.getData().toObject()}},I=function(t,e,r,n){if(t instanceof k){r.push(p(t,e));return}t instanceof K||(process.env.NODE_ENV!=="production"?d(!1,"block is not a BlockNode"):d(!1));var i=t.getParentKey(),c=n[t.getKey()]=b({},p(t,e),{children:[]});if(i){n[i].children.push(c);return}r.push(c)},U=function(t,e){var r=e.entityMap,n=[],i={},c={},l=0;return t.getBlockMap().forEach(function(f){f.findEntityRanges(function(g){return g.getEntity()!==null},function(g){var s=f.getEntityAt(g),u=R.stringify(s);c[u]||(c[u]=s,r[u]="".concat(l),l++)}),I(f,r,n,i)}),{blocks:n,entityMap:r}},P=function(t,e){var r=e.blocks,n=e.entityMap,i={};return Object.keys(n).forEach(function(c,l){var f=t.getEntity(R.unstringify(c));i[l]={type:f.getType(),mutability:f.getMutability(),data:f.getData()}}),{blocks:r,entityMap:i}},j=function(t){var e={entityMap:{},blocks:[]};return e=U(t,e),e=P(t,e),e},A=j,x=a.getRangeClientRects_1;function L(o){var t=x(o),e=0,r=0,n=0,i=0;if(t.length){if(t.length>1&&t[0].width===0){var c=t[1];e=c.top,r=c.right,n=c.bottom,i=c.left}else{var l=t[0];e=l.top,r=l.right,n=l.bottom,i=l.left}for(var f=1;f<t.length;f++){var g=t[f];g.height!==0&&g.width!==0&&(e=Math.min(e,g.top),r=Math.max(r,g.right),n=Math.max(n,g.bottom),i=Math.min(i,g.left))}}return{top:e,right:r,bottom:n,left:i,width:r-i,height:n-e}}var N=L,V=N;function q(o){var t=o.getSelection();if(!t.rangeCount)return null;var e=t.getRangeAt(0),r=V(e),n=r.top,i=r.right,c=r.bottom,l=r.left;return n===0&&i===0&&c===0&&l===0?null:r}var $=q,H=a.AtomicBlockUtils_1,Y=a.BlockMapBuilder_1,z=a.CharacterMetadata_1,J=a.CompositeDraftDecorator_1,G=a.ContentBlock_1,Q=a.ContentState_1,W=a.DefaultDraftBlockRenderMap_1,X=a.DefaultDraftInlineStyle,Z=a.DraftEditor_react,tt=a.DraftEditorBlock_react,et=a.DraftEntity_1,rt=a.DraftModifier_1,nt=a.DraftEntityInstance_1,at=a.EditorState_1,ot=a.KeyBindingUtil_1,it=h,ct=a.RichTextEditorUtil_1,lt=a.SelectionState_1,ft=A,gt=a.convertFromRawToDraftState_1,ut=a.generateRandomKey_1,vt=a.getDefaultKeyBinding_1,st=$,yt=a.convertFromHTMLToContentBlocks_1,dt={Editor:Z,EditorBlock:tt,EditorState:at,CompositeDecorator:J,Entity:et,EntityInstance:nt,BlockMapBuilder:Y,CharacterMetadata:z,ContentBlock:G,ContentState:Q,RawDraftContentState:it,SelectionState:lt,AtomicBlockUtils:H,KeyBindingUtil:ot,Modifier:rt,RichUtils:ct,DefaultDraftBlockRenderMap:W,DefaultDraftInlineStyle:X,convertFromHTML:yt,convertFromRaw:gt,convertToRaw:ft,genKey:ut,getDefaultKeyBinding:vt,getVisibleSelectionRect:st},v=dt;const pt=D.getDefaultExportFromCjs(v),Rt=m({__proto__:null,default:pt},[v]);exports.Draft=Rt;exports.Draft$1=v;
|