@daouypkgs/daouy-embed-css 0.1.220

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/README.md ADDED
@@ -0,0 +1 @@
1
+ Daouy Embed Css Component
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var registerGlobalContext = _interopDefault(require('@daouy/host/registerGlobalContext'));
8
+ var React = _interopDefault(require('react'));
9
+
10
+ function EmbedCss(_ref) {
11
+ var css = _ref.css,
12
+ children = _ref.children;
13
+ if (!css) {
14
+ return React.createElement(React.Fragment, null, children);
15
+ }
16
+ return React.createElement(React.Fragment, null, React.createElement("style", {
17
+ dangerouslySetInnerHTML: {
18
+ __html: css
19
+ }
20
+ }), " ", children);
21
+ }
22
+ var embedCssMeta = {
23
+ name: "global-embed-css",
24
+ displayName: "Embed Css",
25
+ importName: "EmbedCss",
26
+ importPath: "@daouypkgs/daouy-embed-css",
27
+ props: {
28
+ css: {
29
+ type: "code",
30
+ lang: "css",
31
+ defaultValueHint: "/* CSS snippet */",
32
+ description: "CSS rules to be inserted"
33
+ }
34
+ }
35
+ };
36
+ function registerEmbedCss(loader, customEmbedCssMeta) {
37
+ if (loader) {
38
+ loader.registerGlobalContext(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
39
+ } else {
40
+ registerGlobalContext(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
41
+ }
42
+ }
43
+
44
+ exports.EmbedCss = EmbedCss;
45
+ exports.embedCssMeta = embedCssMeta;
46
+ exports.registerEmbedCss = registerEmbedCss;
47
+ //# sourceMappingURL=daouy-embed-css.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daouy-embed-css.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerGlobalContext, {\n GlobalContextMeta,\n} from \"@daouy/host/registerGlobalContext\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css?: string;\n}\n\nexport function EmbedCss({\n css,\n children,\n}: React.PropsWithChildren<EmbedCssProps>) {\n if (!css) {\n return <>{children}</>;\n }\n return (\n <>\n <style dangerouslySetInnerHTML={{ __html: css }} /> {children}\n </>\n );\n}\n\nexport const embedCssMeta: GlobalContextMeta<EmbedCssProps> = {\n name: \"global-embed-css\",\n displayName: \"Embed Css\",\n importName: \"EmbedCss\",\n importPath: \"@daouypkgs/daouy-embed-css\",\n props: {\n css: {\n type: \"code\",\n lang: \"css\",\n defaultValueHint: \"/* CSS snippet */\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerGlobalContext: typeof registerGlobalContext },\n customEmbedCssMeta?: GlobalContextMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n }\n}\n"],"names":["EmbedCss","_ref","css","children","React","dangerouslySetInnerHTML","__html","embedCssMeta","name","displayName","importName","importPath","props","type","lang","defaultValueHint","description","registerEmbedCss","loader","customEmbedCssMeta","registerGlobalContext"],"mappings":";;;;;;;;;SASgBA,QAAQA,CAAAC,IAAA;MACtBC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAER,IAAI,CAACD,GAAG,EAAE;IACR,OAAOE,0CAAGD,QAAQ,CAAI;;EAExB,OACEC,0CACEA;IAAOC,uBAAuB,EAAE;MAAEC,MAAM,EAAEJ;;IAAS,OAAEC,QAAQ,CAC5D;AAEP;IAEaI,YAAY,GAAqC;EAC5DC,IAAI,EAAE,kBAAkB;EACxBC,WAAW,EAAE,WAAW;EACxBC,UAAU,EAAE,UAAU;EACtBC,UAAU,EAAE,4BAA4B;EACxCC,KAAK,EAAE;IACLV,GAAG,EAAE;MACHW,IAAI,EAAE,MAAM;MACZC,IAAI,EAAE,KAAK;MACXC,gBAAgB,EAAE,mBAAmB;MACrCC,WAAW,EAAE;;;;SAKHC,gBAAgBA,CAC9BC,MAAgE,EAChEC,kBAAqD;EAErD,IAAID,MAAM,EAAE;IACVA,MAAM,CAACE,qBAAqB,CAACpB,QAAQ,EAAEmB,kBAAkB,WAAlBA,kBAAkB,GAAIZ,YAAY,CAAC;GAC3E,MAAM;IACLa,qBAAqB,CAACpB,QAAQ,EAAEmB,kBAAkB,WAAlBA,kBAAkB,GAAIZ,YAAY,CAAC;;AAEvE;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@daouy/host/registerGlobalContext")),s=e(require("react"));function r(e){var t=e.css,r=e.children;return t?s.createElement(s.Fragment,null,s.createElement("style",{dangerouslySetInnerHTML:{__html:t}})," ",r):s.createElement(s.Fragment,null,r)}var n={name:"global-embed-css",displayName:"Embed Css",importName:"EmbedCss",importPath:"@daouypkgs/daouy-embed-css",props:{css:{type:"code",lang:"css",defaultValueHint:"/* CSS snippet */",description:"CSS rules to be inserted"}}};exports.EmbedCss=r,exports.embedCssMeta=n,exports.registerEmbedCss=function(e,s){e?e.registerGlobalContext(r,null!=s?s:n):t(r,null!=s?s:n)};
2
+ //# sourceMappingURL=daouy-embed-css.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daouy-embed-css.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerGlobalContext, {\n GlobalContextMeta,\n} from \"@daouy/host/registerGlobalContext\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css?: string;\n}\n\nexport function EmbedCss({\n css,\n children,\n}: React.PropsWithChildren<EmbedCssProps>) {\n if (!css) {\n return <>{children}</>;\n }\n return (\n <>\n <style dangerouslySetInnerHTML={{ __html: css }} /> {children}\n </>\n );\n}\n\nexport const embedCssMeta: GlobalContextMeta<EmbedCssProps> = {\n name: \"global-embed-css\",\n displayName: \"Embed Css\",\n importName: \"EmbedCss\",\n importPath: \"@daouypkgs/daouy-embed-css\",\n props: {\n css: {\n type: \"code\",\n lang: \"css\",\n defaultValueHint: \"/* CSS snippet */\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerGlobalContext: typeof registerGlobalContext },\n customEmbedCssMeta?: GlobalContextMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n }\n}\n"],"names":["EmbedCss","_ref","css","children","React","dangerouslySetInnerHTML","__html","embedCssMeta","name","displayName","importName","importPath","props","type","lang","defaultValueHint","description","loader","customEmbedCssMeta","registerGlobalContext"],"mappings":"+NASgBA,EAAQC,OACtBC,EAAGD,EAAHC,IACAC,EAAQF,EAARE,SAEA,OAAKD,EAIHE,gCACEA,yBAAOC,wBAAyB,CAAEC,OAAQJ,SAAWC,GAJhDC,gCAAGD,OASDI,EAAiD,CAC5DC,KAAM,mBACNC,YAAa,YACbC,WAAY,WACZC,WAAY,6BACZC,MAAO,CACLV,IAAK,CACHW,KAAM,OACNC,KAAM,MACNC,iBAAkB,oBAClBC,YAAa,0GAMjBC,EACAC,GAEID,EACFA,EAAOE,sBAAsBnB,QAAUkB,EAAAA,EAAsBX,GAE7DY,EAAsBnB,QAAUkB,EAAAA,EAAsBX"}
@@ -0,0 +1,39 @@
1
+ import registerGlobalContext from '@daouy/host/registerGlobalContext';
2
+ import React from 'react';
3
+
4
+ function EmbedCss(_ref) {
5
+ var css = _ref.css,
6
+ children = _ref.children;
7
+ if (!css) {
8
+ return React.createElement(React.Fragment, null, children);
9
+ }
10
+ return React.createElement(React.Fragment, null, React.createElement("style", {
11
+ dangerouslySetInnerHTML: {
12
+ __html: css
13
+ }
14
+ }), " ", children);
15
+ }
16
+ var embedCssMeta = {
17
+ name: "global-embed-css",
18
+ displayName: "Embed Css",
19
+ importName: "EmbedCss",
20
+ importPath: "@daouypkgs/daouy-embed-css",
21
+ props: {
22
+ css: {
23
+ type: "code",
24
+ lang: "css",
25
+ defaultValueHint: "/* CSS snippet */",
26
+ description: "CSS rules to be inserted"
27
+ }
28
+ }
29
+ };
30
+ function registerEmbedCss(loader, customEmbedCssMeta) {
31
+ if (loader) {
32
+ loader.registerGlobalContext(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
33
+ } else {
34
+ registerGlobalContext(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
35
+ }
36
+ }
37
+
38
+ export { EmbedCss, embedCssMeta, registerEmbedCss };
39
+ //# sourceMappingURL=daouy-embed-css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daouy-embed-css.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerGlobalContext, {\n GlobalContextMeta,\n} from \"@daouy/host/registerGlobalContext\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css?: string;\n}\n\nexport function EmbedCss({\n css,\n children,\n}: React.PropsWithChildren<EmbedCssProps>) {\n if (!css) {\n return <>{children}</>;\n }\n return (\n <>\n <style dangerouslySetInnerHTML={{ __html: css }} /> {children}\n </>\n );\n}\n\nexport const embedCssMeta: GlobalContextMeta<EmbedCssProps> = {\n name: \"global-embed-css\",\n displayName: \"Embed Css\",\n importName: \"EmbedCss\",\n importPath: \"@daouypkgs/daouy-embed-css\",\n props: {\n css: {\n type: \"code\",\n lang: \"css\",\n defaultValueHint: \"/* CSS snippet */\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerGlobalContext: typeof registerGlobalContext },\n customEmbedCssMeta?: GlobalContextMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerGlobalContext(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n }\n}\n"],"names":["EmbedCss","_ref","css","children","React","dangerouslySetInnerHTML","__html","embedCssMeta","name","displayName","importName","importPath","props","type","lang","defaultValueHint","description","registerEmbedCss","loader","customEmbedCssMeta","registerGlobalContext"],"mappings":";;;SASgBA,QAAQA,CAAAC,IAAA;MACtBC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAER,IAAI,CAACD,GAAG,EAAE;IACR,OAAOE,0CAAGD,QAAQ,CAAI;;EAExB,OACEC,0CACEA;IAAOC,uBAAuB,EAAE;MAAEC,MAAM,EAAEJ;;IAAS,OAAEC,QAAQ,CAC5D;AAEP;IAEaI,YAAY,GAAqC;EAC5DC,IAAI,EAAE,kBAAkB;EACxBC,WAAW,EAAE,WAAW;EACxBC,UAAU,EAAE,UAAU;EACtBC,UAAU,EAAE,4BAA4B;EACxCC,KAAK,EAAE;IACLV,GAAG,EAAE;MACHW,IAAI,EAAE,MAAM;MACZC,IAAI,EAAE,KAAK;MACXC,gBAAgB,EAAE,mBAAmB;MACrCC,WAAW,EAAE;;;;SAKHC,gBAAgBA,CAC9BC,MAAgE,EAChEC,kBAAqD;EAErD,IAAID,MAAM,EAAE;IACVA,MAAM,CAACE,qBAAqB,CAACpB,QAAQ,EAAEmB,kBAAkB,WAAlBA,kBAAkB,GAAIZ,YAAY,CAAC;GAC3E,MAAM;IACLa,qBAAqB,CAACpB,QAAQ,EAAEmB,kBAAkB,WAAlBA,kBAAkB,GAAIZ,YAAY,CAAC;;AAEvE;;;;"}
@@ -0,0 +1,10 @@
1
+ import registerGlobalContext, { GlobalContextMeta } from "@daouy/host/registerGlobalContext";
2
+ import React from "react";
3
+ export interface EmbedCssProps {
4
+ css?: string;
5
+ }
6
+ export declare function EmbedCss({ css, children, }: React.PropsWithChildren<EmbedCssProps>): React.JSX.Element;
7
+ export declare const embedCssMeta: GlobalContextMeta<EmbedCssProps>;
8
+ export declare function registerEmbedCss(loader?: {
9
+ registerGlobalContext: typeof registerGlobalContext;
10
+ }, customEmbedCssMeta?: GlobalContextMeta<EmbedCssProps>): void;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./daouy-embed-css.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./daouy-embed-css.cjs.development.js')
8
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@daouypkgs/daouy-embed-css",
3
+ "version": "0.1.220",
4
+ "description": "Daouy embed css code components",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/daouy-embed-css.esm.js",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "size-limit": [
12
+ {
13
+ "path": "dist/daouy-embed-css.cjs.production.min.js",
14
+ "limit": "20 KB"
15
+ },
16
+ {
17
+ "path": "dist/daouy-embed-css.esm.js",
18
+ "limit": "20 KB"
19
+ }
20
+ ],
21
+ "scripts": {
22
+ "build": "tsdx build",
23
+ "start": "tsdx watch",
24
+ "test": "TEST_CWD=`pwd` yarn --cwd=../.. test --passWithNoTests",
25
+ "lint": "tsdx lint",
26
+ "prepublishOnly": "npm run build",
27
+ "size": "size-limit",
28
+ "analyze": "size-limit --why"
29
+ },
30
+ "devDependencies": {
31
+ "@daouy/host": "^1.0.234",
32
+ "@types/node": "^17.0.14",
33
+ "@types/react": "^18.2.33",
34
+ "tsdx": "^0.14.1",
35
+ "tslib": "^2.3.1"
36
+ },
37
+ "peerDependencies": {
38
+ "@daouy/host": "^1.0.234",
39
+ "react": ">=16.8.0",
40
+ "react-dom": ">=16.8.0"
41
+ }
42
+ }