@calenderjs/react 0.0.2 → 0.3.1

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/index.cjs CHANGED
@@ -22,917 +22,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const require$$0 = require("react");
26
- var jsxRuntime = { exports: {} };
27
- var reactJsxRuntime_production_min = {};
28
- var hasRequiredReactJsxRuntime_production_min;
29
- function requireReactJsxRuntime_production_min() {
30
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
31
- hasRequiredReactJsxRuntime_production_min = 1;
32
- var f = require$$0, k = /* @__PURE__ */ Symbol.for("react.element"), l = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
33
- function q(c, a, g) {
34
- var b, d = {}, e = null, h = null;
35
- void 0 !== g && (e = "" + g);
36
- void 0 !== a.key && (e = "" + a.key);
37
- void 0 !== a.ref && (h = a.ref);
38
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
39
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
40
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
41
- }
42
- reactJsxRuntime_production_min.Fragment = l;
43
- reactJsxRuntime_production_min.jsx = q;
44
- reactJsxRuntime_production_min.jsxs = q;
45
- return reactJsxRuntime_production_min;
46
- }
47
- var reactJsxRuntime_development = {};
48
- var hasRequiredReactJsxRuntime_development;
49
- function requireReactJsxRuntime_development() {
50
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
51
- hasRequiredReactJsxRuntime_development = 1;
52
- if (process.env.NODE_ENV !== "production") {
53
- (function() {
54
- var React = require$$0;
55
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
56
- var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
57
- var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
58
- var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
59
- var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
60
- var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
61
- var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
62
- var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
63
- var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
64
- var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
65
- var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
66
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
67
- var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
68
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
69
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
70
- function getIteratorFn(maybeIterable) {
71
- if (maybeIterable === null || typeof maybeIterable !== "object") {
72
- return null;
73
- }
74
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
75
- if (typeof maybeIterator === "function") {
76
- return maybeIterator;
77
- }
78
- return null;
79
- }
80
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
81
- function error(format) {
82
- {
83
- {
84
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
85
- args[_key2 - 1] = arguments[_key2];
86
- }
87
- printWarning("error", format, args);
88
- }
89
- }
90
- }
91
- function printWarning(level, format, args) {
92
- {
93
- var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
94
- var stack = ReactDebugCurrentFrame2.getStackAddendum();
95
- if (stack !== "") {
96
- format += "%s";
97
- args = args.concat([stack]);
98
- }
99
- var argsWithFormat = args.map(function(item) {
100
- return String(item);
101
- });
102
- argsWithFormat.unshift("Warning: " + format);
103
- Function.prototype.apply.call(console[level], console, argsWithFormat);
104
- }
105
- }
106
- var enableScopeAPI = false;
107
- var enableCacheElement = false;
108
- var enableTransitionTracing = false;
109
- var enableLegacyHidden = false;
110
- var enableDebugTracing = false;
111
- var REACT_MODULE_REFERENCE;
112
- {
113
- REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
114
- }
115
- function isValidElementType(type) {
116
- if (typeof type === "string" || typeof type === "function") {
117
- return true;
118
- }
119
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
120
- return true;
121
- }
122
- if (typeof type === "object" && type !== null) {
123
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
124
- // types supported by any Flight configuration anywhere since
125
- // we don't know which Flight build this will end up being used
126
- // with.
127
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
128
- return true;
129
- }
130
- }
131
- return false;
132
- }
133
- function getWrappedName(outerType, innerType, wrapperName) {
134
- var displayName = outerType.displayName;
135
- if (displayName) {
136
- return displayName;
137
- }
138
- var functionName = innerType.displayName || innerType.name || "";
139
- return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
140
- }
141
- function getContextName(type) {
142
- return type.displayName || "Context";
143
- }
144
- function getComponentNameFromType(type) {
145
- if (type == null) {
146
- return null;
147
- }
148
- {
149
- if (typeof type.tag === "number") {
150
- error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
151
- }
152
- }
153
- if (typeof type === "function") {
154
- return type.displayName || type.name || null;
155
- }
156
- if (typeof type === "string") {
157
- return type;
158
- }
159
- switch (type) {
160
- case REACT_FRAGMENT_TYPE:
161
- return "Fragment";
162
- case REACT_PORTAL_TYPE:
163
- return "Portal";
164
- case REACT_PROFILER_TYPE:
165
- return "Profiler";
166
- case REACT_STRICT_MODE_TYPE:
167
- return "StrictMode";
168
- case REACT_SUSPENSE_TYPE:
169
- return "Suspense";
170
- case REACT_SUSPENSE_LIST_TYPE:
171
- return "SuspenseList";
172
- }
173
- if (typeof type === "object") {
174
- switch (type.$$typeof) {
175
- case REACT_CONTEXT_TYPE:
176
- var context = type;
177
- return getContextName(context) + ".Consumer";
178
- case REACT_PROVIDER_TYPE:
179
- var provider = type;
180
- return getContextName(provider._context) + ".Provider";
181
- case REACT_FORWARD_REF_TYPE:
182
- return getWrappedName(type, type.render, "ForwardRef");
183
- case REACT_MEMO_TYPE:
184
- var outerName = type.displayName || null;
185
- if (outerName !== null) {
186
- return outerName;
187
- }
188
- return getComponentNameFromType(type.type) || "Memo";
189
- case REACT_LAZY_TYPE: {
190
- var lazyComponent = type;
191
- var payload = lazyComponent._payload;
192
- var init = lazyComponent._init;
193
- try {
194
- return getComponentNameFromType(init(payload));
195
- } catch (x) {
196
- return null;
197
- }
198
- }
199
- }
200
- }
201
- return null;
202
- }
203
- var assign = Object.assign;
204
- var disabledDepth = 0;
205
- var prevLog;
206
- var prevInfo;
207
- var prevWarn;
208
- var prevError;
209
- var prevGroup;
210
- var prevGroupCollapsed;
211
- var prevGroupEnd;
212
- function disabledLog() {
213
- }
214
- disabledLog.__reactDisabledLog = true;
215
- function disableLogs() {
216
- {
217
- if (disabledDepth === 0) {
218
- prevLog = console.log;
219
- prevInfo = console.info;
220
- prevWarn = console.warn;
221
- prevError = console.error;
222
- prevGroup = console.group;
223
- prevGroupCollapsed = console.groupCollapsed;
224
- prevGroupEnd = console.groupEnd;
225
- var props = {
226
- configurable: true,
227
- enumerable: true,
228
- value: disabledLog,
229
- writable: true
230
- };
231
- Object.defineProperties(console, {
232
- info: props,
233
- log: props,
234
- warn: props,
235
- error: props,
236
- group: props,
237
- groupCollapsed: props,
238
- groupEnd: props
239
- });
240
- }
241
- disabledDepth++;
242
- }
243
- }
244
- function reenableLogs() {
245
- {
246
- disabledDepth--;
247
- if (disabledDepth === 0) {
248
- var props = {
249
- configurable: true,
250
- enumerable: true,
251
- writable: true
252
- };
253
- Object.defineProperties(console, {
254
- log: assign({}, props, {
255
- value: prevLog
256
- }),
257
- info: assign({}, props, {
258
- value: prevInfo
259
- }),
260
- warn: assign({}, props, {
261
- value: prevWarn
262
- }),
263
- error: assign({}, props, {
264
- value: prevError
265
- }),
266
- group: assign({}, props, {
267
- value: prevGroup
268
- }),
269
- groupCollapsed: assign({}, props, {
270
- value: prevGroupCollapsed
271
- }),
272
- groupEnd: assign({}, props, {
273
- value: prevGroupEnd
274
- })
275
- });
276
- }
277
- if (disabledDepth < 0) {
278
- error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
279
- }
280
- }
281
- }
282
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
283
- var prefix;
284
- function describeBuiltInComponentFrame(name, source, ownerFn) {
285
- {
286
- if (prefix === void 0) {
287
- try {
288
- throw Error();
289
- } catch (x) {
290
- var match = x.stack.trim().match(/\n( *(at )?)/);
291
- prefix = match && match[1] || "";
292
- }
293
- }
294
- return "\n" + prefix + name;
295
- }
296
- }
297
- var reentry = false;
298
- var componentFrameCache;
299
- {
300
- var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
301
- componentFrameCache = new PossiblyWeakMap();
302
- }
303
- function describeNativeComponentFrame(fn, construct) {
304
- if (!fn || reentry) {
305
- return "";
306
- }
307
- {
308
- var frame = componentFrameCache.get(fn);
309
- if (frame !== void 0) {
310
- return frame;
311
- }
312
- }
313
- var control;
314
- reentry = true;
315
- var previousPrepareStackTrace = Error.prepareStackTrace;
316
- Error.prepareStackTrace = void 0;
317
- var previousDispatcher;
318
- {
319
- previousDispatcher = ReactCurrentDispatcher.current;
320
- ReactCurrentDispatcher.current = null;
321
- disableLogs();
322
- }
323
- try {
324
- if (construct) {
325
- var Fake = function() {
326
- throw Error();
327
- };
328
- Object.defineProperty(Fake.prototype, "props", {
329
- set: function() {
330
- throw Error();
331
- }
332
- });
333
- if (typeof Reflect === "object" && Reflect.construct) {
334
- try {
335
- Reflect.construct(Fake, []);
336
- } catch (x) {
337
- control = x;
338
- }
339
- Reflect.construct(fn, [], Fake);
340
- } else {
341
- try {
342
- Fake.call();
343
- } catch (x) {
344
- control = x;
345
- }
346
- fn.call(Fake.prototype);
347
- }
348
- } else {
349
- try {
350
- throw Error();
351
- } catch (x) {
352
- control = x;
353
- }
354
- fn();
355
- }
356
- } catch (sample) {
357
- if (sample && control && typeof sample.stack === "string") {
358
- var sampleLines = sample.stack.split("\n");
359
- var controlLines = control.stack.split("\n");
360
- var s = sampleLines.length - 1;
361
- var c = controlLines.length - 1;
362
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
363
- c--;
364
- }
365
- for (; s >= 1 && c >= 0; s--, c--) {
366
- if (sampleLines[s] !== controlLines[c]) {
367
- if (s !== 1 || c !== 1) {
368
- do {
369
- s--;
370
- c--;
371
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
372
- var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
373
- if (fn.displayName && _frame.includes("<anonymous>")) {
374
- _frame = _frame.replace("<anonymous>", fn.displayName);
375
- }
376
- {
377
- if (typeof fn === "function") {
378
- componentFrameCache.set(fn, _frame);
379
- }
380
- }
381
- return _frame;
382
- }
383
- } while (s >= 1 && c >= 0);
384
- }
385
- break;
386
- }
387
- }
388
- }
389
- } finally {
390
- reentry = false;
391
- {
392
- ReactCurrentDispatcher.current = previousDispatcher;
393
- reenableLogs();
394
- }
395
- Error.prepareStackTrace = previousPrepareStackTrace;
396
- }
397
- var name = fn ? fn.displayName || fn.name : "";
398
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
399
- {
400
- if (typeof fn === "function") {
401
- componentFrameCache.set(fn, syntheticFrame);
402
- }
403
- }
404
- return syntheticFrame;
405
- }
406
- function describeFunctionComponentFrame(fn, source, ownerFn) {
407
- {
408
- return describeNativeComponentFrame(fn, false);
409
- }
410
- }
411
- function shouldConstruct(Component) {
412
- var prototype = Component.prototype;
413
- return !!(prototype && prototype.isReactComponent);
414
- }
415
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
416
- if (type == null) {
417
- return "";
418
- }
419
- if (typeof type === "function") {
420
- {
421
- return describeNativeComponentFrame(type, shouldConstruct(type));
422
- }
423
- }
424
- if (typeof type === "string") {
425
- return describeBuiltInComponentFrame(type);
426
- }
427
- switch (type) {
428
- case REACT_SUSPENSE_TYPE:
429
- return describeBuiltInComponentFrame("Suspense");
430
- case REACT_SUSPENSE_LIST_TYPE:
431
- return describeBuiltInComponentFrame("SuspenseList");
432
- }
433
- if (typeof type === "object") {
434
- switch (type.$$typeof) {
435
- case REACT_FORWARD_REF_TYPE:
436
- return describeFunctionComponentFrame(type.render);
437
- case REACT_MEMO_TYPE:
438
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
439
- case REACT_LAZY_TYPE: {
440
- var lazyComponent = type;
441
- var payload = lazyComponent._payload;
442
- var init = lazyComponent._init;
443
- try {
444
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
445
- } catch (x) {
446
- }
447
- }
448
- }
449
- }
450
- return "";
451
- }
452
- var hasOwnProperty = Object.prototype.hasOwnProperty;
453
- var loggedTypeFailures = {};
454
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
455
- function setCurrentlyValidatingElement(element) {
456
- {
457
- if (element) {
458
- var owner = element._owner;
459
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
460
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
461
- } else {
462
- ReactDebugCurrentFrame.setExtraStackFrame(null);
463
- }
464
- }
465
- }
466
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
467
- {
468
- var has = Function.call.bind(hasOwnProperty);
469
- for (var typeSpecName in typeSpecs) {
470
- if (has(typeSpecs, typeSpecName)) {
471
- var error$1 = void 0;
472
- try {
473
- if (typeof typeSpecs[typeSpecName] !== "function") {
474
- var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
475
- err.name = "Invariant Violation";
476
- throw err;
477
- }
478
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
479
- } catch (ex) {
480
- error$1 = ex;
481
- }
482
- if (error$1 && !(error$1 instanceof Error)) {
483
- setCurrentlyValidatingElement(element);
484
- error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
485
- setCurrentlyValidatingElement(null);
486
- }
487
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
488
- loggedTypeFailures[error$1.message] = true;
489
- setCurrentlyValidatingElement(element);
490
- error("Failed %s type: %s", location, error$1.message);
491
- setCurrentlyValidatingElement(null);
492
- }
493
- }
494
- }
495
- }
496
- }
497
- var isArrayImpl = Array.isArray;
498
- function isArray(a) {
499
- return isArrayImpl(a);
500
- }
501
- function typeName(value) {
502
- {
503
- var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
504
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
505
- return type;
506
- }
507
- }
508
- function willCoercionThrow(value) {
509
- {
510
- try {
511
- testStringCoercion(value);
512
- return false;
513
- } catch (e) {
514
- return true;
515
- }
516
- }
517
- }
518
- function testStringCoercion(value) {
519
- return "" + value;
520
- }
521
- function checkKeyStringCoercion(value) {
522
- {
523
- if (willCoercionThrow(value)) {
524
- error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
525
- return testStringCoercion(value);
526
- }
527
- }
528
- }
529
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
530
- var RESERVED_PROPS = {
531
- key: true,
532
- ref: true,
533
- __self: true,
534
- __source: true
535
- };
536
- var specialPropKeyWarningShown;
537
- var specialPropRefWarningShown;
538
- function hasValidRef(config) {
539
- {
540
- if (hasOwnProperty.call(config, "ref")) {
541
- var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
542
- if (getter && getter.isReactWarning) {
543
- return false;
544
- }
545
- }
546
- }
547
- return config.ref !== void 0;
548
- }
549
- function hasValidKey(config) {
550
- {
551
- if (hasOwnProperty.call(config, "key")) {
552
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
553
- if (getter && getter.isReactWarning) {
554
- return false;
555
- }
556
- }
557
- }
558
- return config.key !== void 0;
559
- }
560
- function warnIfStringRefCannotBeAutoConverted(config, self) {
561
- {
562
- if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
563
- }
564
- }
565
- function defineKeyPropWarningGetter(props, displayName) {
566
- {
567
- var warnAboutAccessingKey = function() {
568
- if (!specialPropKeyWarningShown) {
569
- specialPropKeyWarningShown = true;
570
- error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
571
- }
572
- };
573
- warnAboutAccessingKey.isReactWarning = true;
574
- Object.defineProperty(props, "key", {
575
- get: warnAboutAccessingKey,
576
- configurable: true
577
- });
578
- }
579
- }
580
- function defineRefPropWarningGetter(props, displayName) {
581
- {
582
- var warnAboutAccessingRef = function() {
583
- if (!specialPropRefWarningShown) {
584
- specialPropRefWarningShown = true;
585
- error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
586
- }
587
- };
588
- warnAboutAccessingRef.isReactWarning = true;
589
- Object.defineProperty(props, "ref", {
590
- get: warnAboutAccessingRef,
591
- configurable: true
592
- });
593
- }
594
- }
595
- var ReactElement = function(type, key, ref, self, source, owner, props) {
596
- var element = {
597
- // This tag allows us to uniquely identify this as a React Element
598
- $$typeof: REACT_ELEMENT_TYPE,
599
- // Built-in properties that belong on the element
600
- type,
601
- key,
602
- ref,
603
- props,
604
- // Record the component responsible for creating this element.
605
- _owner: owner
606
- };
607
- {
608
- element._store = {};
609
- Object.defineProperty(element._store, "validated", {
610
- configurable: false,
611
- enumerable: false,
612
- writable: true,
613
- value: false
614
- });
615
- Object.defineProperty(element, "_self", {
616
- configurable: false,
617
- enumerable: false,
618
- writable: false,
619
- value: self
620
- });
621
- Object.defineProperty(element, "_source", {
622
- configurable: false,
623
- enumerable: false,
624
- writable: false,
625
- value: source
626
- });
627
- if (Object.freeze) {
628
- Object.freeze(element.props);
629
- Object.freeze(element);
630
- }
631
- }
632
- return element;
633
- };
634
- function jsxDEV(type, config, maybeKey, source, self) {
635
- {
636
- var propName;
637
- var props = {};
638
- var key = null;
639
- var ref = null;
640
- if (maybeKey !== void 0) {
641
- {
642
- checkKeyStringCoercion(maybeKey);
643
- }
644
- key = "" + maybeKey;
645
- }
646
- if (hasValidKey(config)) {
647
- {
648
- checkKeyStringCoercion(config.key);
649
- }
650
- key = "" + config.key;
651
- }
652
- if (hasValidRef(config)) {
653
- ref = config.ref;
654
- warnIfStringRefCannotBeAutoConverted(config, self);
655
- }
656
- for (propName in config) {
657
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
658
- props[propName] = config[propName];
659
- }
660
- }
661
- if (type && type.defaultProps) {
662
- var defaultProps = type.defaultProps;
663
- for (propName in defaultProps) {
664
- if (props[propName] === void 0) {
665
- props[propName] = defaultProps[propName];
666
- }
667
- }
668
- }
669
- if (key || ref) {
670
- var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
671
- if (key) {
672
- defineKeyPropWarningGetter(props, displayName);
673
- }
674
- if (ref) {
675
- defineRefPropWarningGetter(props, displayName);
676
- }
677
- }
678
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
679
- }
680
- }
681
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
682
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
683
- function setCurrentlyValidatingElement$1(element) {
684
- {
685
- if (element) {
686
- var owner = element._owner;
687
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
688
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
689
- } else {
690
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
691
- }
692
- }
693
- }
694
- var propTypesMisspellWarningShown;
695
- {
696
- propTypesMisspellWarningShown = false;
697
- }
698
- function isValidElement(object) {
699
- {
700
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
701
- }
702
- }
703
- function getDeclarationErrorAddendum() {
704
- {
705
- if (ReactCurrentOwner$1.current) {
706
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
707
- if (name) {
708
- return "\n\nCheck the render method of `" + name + "`.";
709
- }
710
- }
711
- return "";
712
- }
713
- }
714
- function getSourceInfoErrorAddendum(source) {
715
- {
716
- return "";
717
- }
718
- }
719
- var ownerHasKeyUseWarning = {};
720
- function getCurrentComponentErrorInfo(parentType) {
721
- {
722
- var info = getDeclarationErrorAddendum();
723
- if (!info) {
724
- var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
725
- if (parentName) {
726
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
727
- }
728
- }
729
- return info;
730
- }
731
- }
732
- function validateExplicitKey(element, parentType) {
733
- {
734
- if (!element._store || element._store.validated || element.key != null) {
735
- return;
736
- }
737
- element._store.validated = true;
738
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
739
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
740
- return;
741
- }
742
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
743
- var childOwner = "";
744
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
745
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
746
- }
747
- setCurrentlyValidatingElement$1(element);
748
- error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
749
- setCurrentlyValidatingElement$1(null);
750
- }
751
- }
752
- function validateChildKeys(node, parentType) {
753
- {
754
- if (typeof node !== "object") {
755
- return;
756
- }
757
- if (isArray(node)) {
758
- for (var i = 0; i < node.length; i++) {
759
- var child = node[i];
760
- if (isValidElement(child)) {
761
- validateExplicitKey(child, parentType);
762
- }
763
- }
764
- } else if (isValidElement(node)) {
765
- if (node._store) {
766
- node._store.validated = true;
767
- }
768
- } else if (node) {
769
- var iteratorFn = getIteratorFn(node);
770
- if (typeof iteratorFn === "function") {
771
- if (iteratorFn !== node.entries) {
772
- var iterator = iteratorFn.call(node);
773
- var step;
774
- while (!(step = iterator.next()).done) {
775
- if (isValidElement(step.value)) {
776
- validateExplicitKey(step.value, parentType);
777
- }
778
- }
779
- }
780
- }
781
- }
782
- }
783
- }
784
- function validatePropTypes(element) {
785
- {
786
- var type = element.type;
787
- if (type === null || type === void 0 || typeof type === "string") {
788
- return;
789
- }
790
- var propTypes;
791
- if (typeof type === "function") {
792
- propTypes = type.propTypes;
793
- } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
794
- // Inner props are checked in the reconciler.
795
- type.$$typeof === REACT_MEMO_TYPE)) {
796
- propTypes = type.propTypes;
797
- } else {
798
- return;
799
- }
800
- if (propTypes) {
801
- var name = getComponentNameFromType(type);
802
- checkPropTypes(propTypes, element.props, "prop", name, element);
803
- } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
804
- propTypesMisspellWarningShown = true;
805
- var _name = getComponentNameFromType(type);
806
- error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
807
- }
808
- if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
809
- error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
810
- }
811
- }
812
- }
813
- function validateFragmentProps(fragment) {
814
- {
815
- var keys = Object.keys(fragment.props);
816
- for (var i = 0; i < keys.length; i++) {
817
- var key = keys[i];
818
- if (key !== "children" && key !== "key") {
819
- setCurrentlyValidatingElement$1(fragment);
820
- error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
821
- setCurrentlyValidatingElement$1(null);
822
- break;
823
- }
824
- }
825
- if (fragment.ref !== null) {
826
- setCurrentlyValidatingElement$1(fragment);
827
- error("Invalid attribute `ref` supplied to `React.Fragment`.");
828
- setCurrentlyValidatingElement$1(null);
829
- }
830
- }
831
- }
832
- var didWarnAboutKeySpread = {};
833
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
834
- {
835
- var validType = isValidElementType(type);
836
- if (!validType) {
837
- var info = "";
838
- if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
839
- info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
840
- }
841
- var sourceInfo = getSourceInfoErrorAddendum();
842
- if (sourceInfo) {
843
- info += sourceInfo;
844
- } else {
845
- info += getDeclarationErrorAddendum();
846
- }
847
- var typeString;
848
- if (type === null) {
849
- typeString = "null";
850
- } else if (isArray(type)) {
851
- typeString = "array";
852
- } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
853
- typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
854
- info = " Did you accidentally export a JSX literal instead of a component?";
855
- } else {
856
- typeString = typeof type;
857
- }
858
- error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
859
- }
860
- var element = jsxDEV(type, props, key, source, self);
861
- if (element == null) {
862
- return element;
863
- }
864
- if (validType) {
865
- var children = props.children;
866
- if (children !== void 0) {
867
- if (isStaticChildren) {
868
- if (isArray(children)) {
869
- for (var i = 0; i < children.length; i++) {
870
- validateChildKeys(children[i], type);
871
- }
872
- if (Object.freeze) {
873
- Object.freeze(children);
874
- }
875
- } else {
876
- error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
877
- }
878
- } else {
879
- validateChildKeys(children, type);
880
- }
881
- }
882
- }
883
- {
884
- if (hasOwnProperty.call(props, "key")) {
885
- var componentName = getComponentNameFromType(type);
886
- var keys = Object.keys(props).filter(function(k) {
887
- return k !== "key";
888
- });
889
- var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
890
- if (!didWarnAboutKeySpread[componentName + beforeExample]) {
891
- var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
892
- error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
893
- didWarnAboutKeySpread[componentName + beforeExample] = true;
894
- }
895
- }
896
- }
897
- if (type === REACT_FRAGMENT_TYPE) {
898
- validateFragmentProps(element);
899
- } else {
900
- validatePropTypes(element);
901
- }
902
- return element;
903
- }
904
- }
905
- function jsxWithValidationStatic(type, props, key) {
906
- {
907
- return jsxWithValidation(type, props, key, true);
908
- }
909
- }
910
- function jsxWithValidationDynamic(type, props, key) {
911
- {
912
- return jsxWithValidation(type, props, key, false);
913
- }
914
- }
915
- var jsx = jsxWithValidationDynamic;
916
- var jsxs = jsxWithValidationStatic;
917
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
918
- reactJsxRuntime_development.jsx = jsx;
919
- reactJsxRuntime_development.jsxs = jsxs;
920
- })();
921
- }
922
- return reactJsxRuntime_development;
923
- }
924
- var hasRequiredJsxRuntime;
925
- function requireJsxRuntime() {
926
- if (hasRequiredJsxRuntime) return jsxRuntime.exports;
927
- hasRequiredJsxRuntime = 1;
928
- if (process.env.NODE_ENV === "production") {
929
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
930
- } else {
931
- jsxRuntime.exports = requireReactJsxRuntime_development();
932
- }
933
- return jsxRuntime.exports;
934
- }
935
- var jsxRuntimeExports = requireJsxRuntime();
25
+ const jsxRuntime = require("react/jsx-runtime");
26
+ const react = require("react");
936
27
  let calendarRegistered = false;
937
28
  const registerCalendar = () => {
938
29
  if (typeof window !== "undefined" && !calendarRegistered) {
@@ -940,7 +31,7 @@ const registerCalendar = () => {
940
31
  calendarRegistered = true;
941
32
  }
942
33
  };
943
- const Calendar = require$$0.forwardRef(
34
+ const Calendar = react.forwardRef(
944
35
  ({
945
36
  view = "month",
946
37
  date,
@@ -954,13 +45,13 @@ const Calendar = require$$0.forwardRef(
954
45
  style,
955
46
  ...rest
956
47
  }, ref) => {
957
- const calendarRef = require$$0.useRef(null);
958
- const [isClient, setIsClient] = require$$0.useState(false);
959
- require$$0.useEffect(() => {
48
+ const calendarRef = react.useRef(null);
49
+ const [isClient, setIsClient] = react.useState(false);
50
+ react.useEffect(() => {
960
51
  setIsClient(true);
961
52
  registerCalendar();
962
53
  }, []);
963
- require$$0.useImperativeHandle(ref, () => ({
54
+ react.useImperativeHandle(ref, () => ({
964
55
  getElement: () => calendarRef.current,
965
56
  setView: (newView) => {
966
57
  if (calendarRef.current) {
@@ -979,7 +70,7 @@ const Calendar = require$$0.forwardRef(
979
70
  }
980
71
  }
981
72
  }));
982
- require$$0.useEffect(() => {
73
+ react.useEffect(() => {
983
74
  if (!calendarRef.current) return;
984
75
  const element = calendarRef.current;
985
76
  if (view !== void 0) {
@@ -995,16 +86,14 @@ const Calendar = require$$0.forwardRef(
995
86
  element.user = user;
996
87
  }
997
88
  }, [view, date, events, user]);
998
- require$$0.useEffect(() => {
89
+ react.useEffect(() => {
999
90
  if (!calendarRef.current) return;
1000
91
  const element = calendarRef.current;
1001
92
  const handleDateChange = (e) => {
1002
93
  onDateChange?.(e);
1003
94
  };
1004
95
  const handleViewChange = (e) => {
1005
- onViewChange?.(
1006
- e
1007
- );
96
+ onViewChange?.(e);
1008
97
  };
1009
98
  const handleEventClick = (e) => {
1010
99
  onEventClick?.(e);
@@ -1015,32 +104,32 @@ const Calendar = require$$0.forwardRef(
1015
104
  element.addEventListener("date-change", handleDateChange);
1016
105
  element.addEventListener("view-change", handleViewChange);
1017
106
  element.addEventListener("event-click", handleEventClick);
1018
- element.addEventListener(
1019
- "date-double-click",
1020
- handleDateDoubleClick
1021
- );
107
+ element.addEventListener("date-double-click", handleDateDoubleClick);
1022
108
  return () => {
1023
109
  element.removeEventListener("date-change", handleDateChange);
1024
110
  element.removeEventListener("view-change", handleViewChange);
1025
111
  element.removeEventListener("event-click", handleEventClick);
1026
- element.removeEventListener(
1027
- "date-double-click",
1028
- handleDateDoubleClick
1029
- );
112
+ element.removeEventListener("date-double-click", handleDateDoubleClick);
1030
113
  };
1031
114
  }, [onDateChange, onViewChange, onEventClick, onDateDoubleClick]);
1032
115
  if (!isClient) {
1033
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
116
+ return /* @__PURE__ */ jsxRuntime.jsx(
1034
117
  "div",
1035
118
  {
1036
119
  className,
1037
- style: { ...style, minHeight: "600px", display: "flex", alignItems: "center", justifyContent: "center" },
120
+ style: {
121
+ ...style,
122
+ minHeight: "600px",
123
+ display: "flex",
124
+ alignItems: "center",
125
+ justifyContent: "center"
126
+ },
1038
127
  ...rest,
1039
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "加载中..." })
128
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "加载中..." })
1040
129
  }
1041
130
  );
1042
131
  }
1043
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
132
+ return /* @__PURE__ */ jsxRuntime.jsx(
1044
133
  "wsx-calendar",
1045
134
  {
1046
135
  ref: calendarRef,
@@ -1060,15 +149,15 @@ function ResizableSplitter({
1060
149
  maxLeftWidth = 80,
1061
150
  className = ""
1062
151
  }) {
1063
- const [leftWidth, setLeftWidth] = require$$0.useState(initialLeftWidth);
1064
- const [isDragging, setIsDragging] = require$$0.useState(false);
1065
- const containerRef = require$$0.useRef(null);
1066
- const splitterRef = require$$0.useRef(null);
1067
- const handleMouseDown = require$$0.useCallback((e) => {
152
+ const [leftWidth, setLeftWidth] = react.useState(initialLeftWidth);
153
+ const [isDragging, setIsDragging] = react.useState(false);
154
+ const containerRef = react.useRef(null);
155
+ const splitterRef = react.useRef(null);
156
+ const handleMouseDown = react.useCallback((e) => {
1068
157
  e.preventDefault();
1069
158
  setIsDragging(true);
1070
159
  }, []);
1071
- const handleMouseMove = require$$0.useCallback(
160
+ const handleMouseMove = react.useCallback(
1072
161
  (e) => {
1073
162
  if (!isDragging || !containerRef.current) return;
1074
163
  const containerRect = containerRef.current.getBoundingClientRect();
@@ -1081,10 +170,10 @@ function ResizableSplitter({
1081
170
  },
1082
171
  [isDragging, minLeftWidth, maxLeftWidth]
1083
172
  );
1084
- const handleMouseUp = require$$0.useCallback(() => {
173
+ const handleMouseUp = react.useCallback(() => {
1085
174
  setIsDragging(false);
1086
175
  }, []);
1087
- require$$0.useEffect(() => {
176
+ react.useEffect(() => {
1088
177
  if (isDragging) {
1089
178
  document.addEventListener("mousemove", handleMouseMove);
1090
179
  document.addEventListener("mouseup", handleMouseUp);
@@ -1098,7 +187,7 @@ function ResizableSplitter({
1098
187
  };
1099
188
  }
1100
189
  }, [isDragging, handleMouseMove, handleMouseUp]);
1101
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
190
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1102
191
  "div",
1103
192
  {
1104
193
  ref: containerRef,
@@ -1110,7 +199,7 @@ function ResizableSplitter({
1110
199
  position: "relative"
1111
200
  },
1112
201
  children: [
1113
- /* @__PURE__ */ jsxRuntimeExports.jsx(
202
+ /* @__PURE__ */ jsxRuntime.jsx(
1114
203
  "div",
1115
204
  {
1116
205
  style: {
@@ -1123,7 +212,7 @@ function ResizableSplitter({
1123
212
  children: left
1124
213
  }
1125
214
  ),
1126
- /* @__PURE__ */ jsxRuntimeExports.jsx(
215
+ /* @__PURE__ */ jsxRuntime.jsx(
1127
216
  "div",
1128
217
  {
1129
218
  ref: splitterRef,
@@ -1147,7 +236,7 @@ function ResizableSplitter({
1147
236
  e.currentTarget.style.backgroundColor = "var(--resizable-splitter-bg-color, #ddd)";
1148
237
  }
1149
238
  },
1150
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
239
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1151
240
  "div",
1152
241
  {
1153
242
  style: {
@@ -1164,7 +253,7 @@ function ResizableSplitter({
1164
253
  justifyContent: "center",
1165
254
  pointerEvents: "none"
1166
255
  },
1167
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
256
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1168
257
  "div",
1169
258
  {
1170
259
  style: {
@@ -1173,7 +262,7 @@ function ResizableSplitter({
1173
262
  gap: "var(--resizable-splitter-dot-gap, 2px)"
1174
263
  },
1175
264
  children: [
1176
- /* @__PURE__ */ jsxRuntimeExports.jsx(
265
+ /* @__PURE__ */ jsxRuntime.jsx(
1177
266
  "div",
1178
267
  {
1179
268
  style: {
@@ -1184,7 +273,7 @@ function ResizableSplitter({
1184
273
  }
1185
274
  }
1186
275
  ),
1187
- /* @__PURE__ */ jsxRuntimeExports.jsx(
276
+ /* @__PURE__ */ jsxRuntime.jsx(
1188
277
  "div",
1189
278
  {
1190
279
  style: {
@@ -1195,7 +284,7 @@ function ResizableSplitter({
1195
284
  }
1196
285
  }
1197
286
  ),
1198
- /* @__PURE__ */ jsxRuntimeExports.jsx(
287
+ /* @__PURE__ */ jsxRuntime.jsx(
1199
288
  "div",
1200
289
  {
1201
290
  style: {
@@ -1213,7 +302,7 @@ function ResizableSplitter({
1213
302
  )
1214
303
  }
1215
304
  ),
1216
- /* @__PURE__ */ jsxRuntimeExports.jsx(
305
+ /* @__PURE__ */ jsxRuntime.jsx(
1217
306
  "div",
1218
307
  {
1219
308
  style: {
@@ -1230,306 +319,6 @@ function ResizableSplitter({
1230
319
  }
1231
320
  );
1232
321
  }
1233
- let r = false;
1234
- function o(e) {
1235
- r || (r = true, e.languages.register({ id: "event-dsl" }), e.languages.setMonarchTokensProvider("event-dsl", {
1236
- // 关键字
1237
- keywords: [
1238
- "type",
1239
- "name",
1240
- "description",
1241
- "fields",
1242
- "validate",
1243
- "display",
1244
- "behavior",
1245
- "required",
1246
- "of",
1247
- "and",
1248
- "or",
1249
- "not",
1250
- "between",
1251
- "in",
1252
- "is",
1253
- "equals",
1254
- "not equals",
1255
- "when",
1256
- "conflict",
1257
- "recurring",
1258
- "constraints"
1259
- ],
1260
- // 操作符
1261
- operators: [">=", "<=", ">", "<", "=", "!=", "mod"],
1262
- // 类型
1263
- types: [
1264
- "string",
1265
- "number",
1266
- "boolean",
1267
- "email",
1268
- "url",
1269
- "date",
1270
- "time",
1271
- "datetime",
1272
- "list"
1273
- ],
1274
- // 符号
1275
- symbols: /[=><!?:&|+\-*\/\^%]+/,
1276
- // 转义序列
1277
- escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
1278
- // 词法规则
1279
- tokenizer: {
1280
- root: [
1281
- // 关键字
1282
- [
1283
- /\b(type|name|description|fields|validate|display|behavior|required|and|or|not|between|in|is|equals|when|conflict|recurring|constraints)\b/,
1284
- "keyword"
1285
- ],
1286
- // 类型
1287
- [
1288
- /\b(string|number|boolean|email|url|date|time|datetime|list)\b/,
1289
- "type"
1290
- ],
1291
- // 操作符
1292
- [/>=|<=|>|<|==|!=|mod/, "operator"],
1293
- // 字符串字面量(双引号)
1294
- [/"[^"]*"/, "string"],
1295
- // 字符串字面量(单引号)
1296
- [/'[^']*'/, "string"],
1297
- // 数字
1298
- [/\d+/, "number"],
1299
- // 布尔值
1300
- [/\b(true|false)\b/, "number"],
1301
- // 颜色值(十六进制)
1302
- [/#[0-9A-Fa-f]{6}/, "string"],
1303
- // 字段访问(如 attendees.count, startTime.hour)
1304
- [
1305
- /[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)+/,
1306
- "variable"
1307
- ],
1308
- // 标识符
1309
- [/[a-zA-Z_][a-zA-Z0-9_]*/, "identifier"],
1310
- // 注释(以 # 开头)
1311
- [/#.*$/, "comment"],
1312
- // 列表项(以 - 开头)
1313
- [/^\s*-\s*/, "keyword"],
1314
- // 冒号(用于键值对)
1315
- [/:/, "delimiter"],
1316
- // 空白字符
1317
- { include: "@whitespace" }
1318
- ],
1319
- whitespace: [[/[ \t\r\n]+/, "white"]]
1320
- }
1321
- }), e.languages.registerCompletionItemProvider("event-dsl", {
1322
- provideCompletionItems: (l, n) => {
1323
- const i = l.getWordUntilPosition(n), t = {
1324
- startLineNumber: n.lineNumber,
1325
- endLineNumber: n.lineNumber,
1326
- startColumn: i.startColumn,
1327
- endColumn: i.endColumn
1328
- };
1329
- return { suggestions: [
1330
- // 顶级关键字
1331
- {
1332
- label: "type",
1333
- kind: e.languages.CompletionItemKind.Keyword,
1334
- insertText: "type: ${1:event-type}",
1335
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1336
- documentation: "定义事件类型",
1337
- range: t
1338
- },
1339
- {
1340
- label: "name",
1341
- kind: e.languages.CompletionItemKind.Keyword,
1342
- insertText: 'name: "${1:事件名称}"',
1343
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1344
- documentation: "事件类型名称",
1345
- range: t
1346
- },
1347
- {
1348
- label: "description",
1349
- kind: e.languages.CompletionItemKind.Keyword,
1350
- insertText: 'description: "${1:事件描述}"',
1351
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1352
- documentation: "事件类型描述",
1353
- range: t
1354
- },
1355
- {
1356
- label: "fields",
1357
- kind: e.languages.CompletionItemKind.Keyword,
1358
- insertText: "fields:\n - ${1:fieldName}: ${2:string}",
1359
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1360
- documentation: "定义事件字段",
1361
- range: t
1362
- },
1363
- {
1364
- label: "validate",
1365
- kind: e.languages.CompletionItemKind.Keyword,
1366
- insertText: "validate:\n ${1:field} ${2:>=} ${3:value}",
1367
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1368
- documentation: "定义验证规则",
1369
- range: t
1370
- },
1371
- {
1372
- label: "display",
1373
- kind: e.languages.CompletionItemKind.Keyword,
1374
- insertText: 'display:\n color: "${1:#4285f4}"\n icon: "${2:icon-name}"',
1375
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1376
- documentation: "定义显示属性",
1377
- range: t
1378
- },
1379
- {
1380
- label: "behavior",
1381
- kind: e.languages.CompletionItemKind.Keyword,
1382
- insertText: "behavior:\n editable: ${1:true}\n draggable: ${2:true}",
1383
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1384
- documentation: "定义行为属性",
1385
- range: t
1386
- },
1387
- // 字段类型
1388
- {
1389
- label: "string",
1390
- kind: e.languages.CompletionItemKind.TypeParameter,
1391
- insertText: "string",
1392
- documentation: "字符串类型",
1393
- range: t
1394
- },
1395
- {
1396
- label: "number",
1397
- kind: e.languages.CompletionItemKind.TypeParameter,
1398
- insertText: "number",
1399
- documentation: "数字类型",
1400
- range: t
1401
- },
1402
- {
1403
- label: "boolean",
1404
- kind: e.languages.CompletionItemKind.TypeParameter,
1405
- insertText: "boolean",
1406
- documentation: "布尔类型",
1407
- range: t
1408
- },
1409
- {
1410
- label: "email",
1411
- kind: e.languages.CompletionItemKind.TypeParameter,
1412
- insertText: "email",
1413
- documentation: "邮箱类型",
1414
- range: t
1415
- },
1416
- {
1417
- label: "list of",
1418
- kind: e.languages.CompletionItemKind.TypeParameter,
1419
- insertText: "list of ${1:string}",
1420
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1421
- documentation: "列表类型",
1422
- range: t
1423
- },
1424
- // 操作符
1425
- {
1426
- label: ">=",
1427
- kind: e.languages.CompletionItemKind.Operator,
1428
- insertText: ">=",
1429
- documentation: "大于等于",
1430
- range: t
1431
- },
1432
- {
1433
- label: "<=",
1434
- kind: e.languages.CompletionItemKind.Operator,
1435
- insertText: "<=",
1436
- documentation: "小于等于",
1437
- range: t
1438
- },
1439
- {
1440
- label: "between",
1441
- kind: e.languages.CompletionItemKind.Operator,
1442
- insertText: "between ${1:min} and ${2:max}",
1443
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1444
- documentation: "范围检查",
1445
- range: t
1446
- }
1447
- ] };
1448
- }
1449
- }), e.editor.defineTheme("event-dsl-theme", {
1450
- base: "vs",
1451
- inherit: true,
1452
- rules: [
1453
- { token: "keyword", foreground: "0000ff", fontStyle: "bold" },
1454
- { token: "type", foreground: "267f99" },
1455
- { token: "string", foreground: "a31515" },
1456
- { token: "number", foreground: "098658" },
1457
- { token: "operator", foreground: "000000", fontStyle: "bold" },
1458
- { token: "comment", foreground: "008000", fontStyle: "italic" },
1459
- { token: "variable", foreground: "001080" }
1460
- ],
1461
- colors: {}
1462
- }), e.editor.defineTheme("event-dsl-theme-dark", {
1463
- base: "vs-dark",
1464
- inherit: true,
1465
- rules: [
1466
- { token: "keyword", foreground: "569cd6", fontStyle: "bold" },
1467
- { token: "type", foreground: "4ec9b0" },
1468
- { token: "string", foreground: "ce9178" },
1469
- { token: "number", foreground: "b5cea8" },
1470
- { token: "operator", foreground: "d4d4d4", fontStyle: "bold" },
1471
- { token: "comment", foreground: "6a9955", fontStyle: "italic" },
1472
- { token: "variable", foreground: "9cdcfe" }
1473
- ],
1474
- colors: {}
1475
- }));
1476
- }
1477
- function EventEditor({
1478
- value = "",
1479
- onChange,
1480
- height = "100%",
1481
- darkMode = false,
1482
- className = "",
1483
- style,
1484
- options,
1485
- onMount,
1486
- EditorComponent
1487
- }) {
1488
- const handleMount = (editor, monaco) => {
1489
- o(monaco);
1490
- onMount?.(editor, monaco);
1491
- };
1492
- const editorOptions = require$$0.useMemo(
1493
- () => ({
1494
- minimap: { enabled: false },
1495
- fontSize: 14,
1496
- wordWrap: "on",
1497
- lineNumbers: "on",
1498
- scrollBeyondLastLine: false,
1499
- suggestOnTriggerCharacters: true,
1500
- quickSuggestions: true,
1501
- tabSize: 2,
1502
- autoIndent: "full",
1503
- ...options
1504
- }),
1505
- [options]
1506
- );
1507
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1508
- "div",
1509
- {
1510
- className: `event-editor ${className}`,
1511
- style: {
1512
- ...style,
1513
- height: typeof height === "number" ? `${height}px` : height,
1514
- width: "100%",
1515
- backgroundColor: darkMode ? "var(--event-editor-bg-color-dark, #1e1e1e)" : "var(--event-editor-bg-color, #fff)"
1516
- },
1517
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1518
- EditorComponent,
1519
- {
1520
- height: "100%",
1521
- language: "event-dsl",
1522
- value,
1523
- onChange,
1524
- theme: darkMode ? "event-dsl-theme-dark" : "event-dsl-theme",
1525
- onMount: handleMount,
1526
- options: editorOptions
1527
- }
1528
- )
1529
- }
1530
- );
1531
- }
1532
322
  exports.Calendar = Calendar;
1533
- exports.EventEditor = EventEditor;
1534
323
  exports.ResizableSplitter = ResizableSplitter;
1535
324
  //# sourceMappingURL=index.cjs.map