UNPKG

2.91 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3 typeof define === 'function' && define.amd ? define(['exports'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.F2JSXRuntime = {}));
5}(this, (function (exports) { 'use strict';
6
7 function getDefaultExportFromCjs (x) {
8 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9 }
10
11 function createCommonjsModule(fn, basedir, module) {
12 return module = {
13 path: basedir,
14 exports: {},
15 require: function (path, base) {
16 return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
17 }
18 }, fn(module, module.exports), module.exports;
19 }
20
21 function commonjsRequire () {
22 throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
23 }
24
25 var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
26 function _objectWithoutPropertiesLoose(source, excluded) {
27 if (source == null) return {};
28 var target = {};
29 var sourceKeys = Object.keys(source);
30 var key, i;
31
32 for (i = 0; i < sourceKeys.length; i++) {
33 key = sourceKeys[i];
34 if (excluded.indexOf(key) >= 0) continue;
35 target[key] = source[key];
36 }
37
38 return target;
39 }
40
41 module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
42 });
43
44 var objectWithoutProperties = createCommonjsModule(function (module) {
45 function _objectWithoutProperties(source, excluded) {
46 if (source == null) return {};
47 var target = objectWithoutPropertiesLoose(source, excluded);
48 var key, i;
49
50 if (Object.getOwnPropertySymbols) {
51 var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
52
53 for (i = 0; i < sourceSymbolKeys.length; i++) {
54 key = sourceSymbolKeys[i];
55 if (excluded.indexOf(key) >= 0) continue;
56 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
57 target[key] = source[key];
58 }
59 }
60
61 return target;
62 }
63
64 module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
65 });
66
67 var _objectWithoutProperties = /*@__PURE__*/getDefaultExportFromCjs(objectWithoutProperties);
68
69 var _excluded = ["ref"];
70 // 实现jsx-automatic 入口
71 function jsx(type, config, key) {
72 var _ref = config || {},
73 ref = _ref.ref,
74 props = _objectWithoutProperties(_ref, _excluded);
75
76 return {
77 key: key,
78 ref: ref,
79 type: type,
80 props: props,
81 // 存储一些过程中的cache值
82 _cache: {}
83 };
84 }
85
86 var fragment = (function (props) {
87 return props.children;
88 });
89
90 exports.Fragment = fragment;
91 exports.jsx = jsx;
92 exports.jsxDEV = jsx;
93 exports.jsxs = jsx;
94
95 Object.defineProperty(exports, '__esModule', { value: true });
96
97})));