@bigbinary/neeto-molecules 5.3.14 → 5.3.16
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/ProductEmbed.js +15 -14
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +15 -14
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/v2/MadeWith.js +5 -3
- package/dist/cjs/v2/MadeWith.js.map +1 -1
- package/dist/cjs/v2/ProductEmbed.js +6 -5
- package/dist/cjs/v2/ProductEmbed.js.map +1 -1
- package/dist/v2/MadeWith.js +5 -3
- package/dist/v2/MadeWith.js.map +1 -1
- package/dist/v2/ProductEmbed.js +6 -5
- package/dist/v2/ProductEmbed.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/v2/MadeWith.js
CHANGED
|
@@ -4,6 +4,7 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
7
|
+
var classnames = require('classnames');
|
|
7
8
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
8
9
|
var initializers = require('@bigbinary/neeto-commons-frontend/v2/initializers');
|
|
9
10
|
var Icons = require('@bigbinary/neeto-icons/logos');
|
|
@@ -31,24 +32,25 @@ function _interopNamespaceDefault(e) {
|
|
|
31
32
|
|
|
32
33
|
var Icons__namespace = /*#__PURE__*/_interopNamespaceDefault(Icons);
|
|
33
34
|
|
|
34
|
-
var _excluded = ["productName", "productIcon"];
|
|
35
|
+
var _excluded = ["productName", "productIcon", "className"];
|
|
35
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
38
|
var MadeWith = function MadeWith(_ref) {
|
|
38
39
|
var _globalProps$organiza;
|
|
39
40
|
var productName = _ref.productName,
|
|
40
41
|
ProductIcon = _ref.productIcon,
|
|
42
|
+
className = _ref.className,
|
|
41
43
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
42
44
|
var name = neetoCist.capitalize(productName || initializers.globalProps.appName || "Neeto");
|
|
43
45
|
var subdomain = (_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain;
|
|
44
46
|
var utmParams = "utm_source=madewith".concat(subdomain ? "&utm_campaign=".concat(subdomain) : "");
|
|
45
47
|
var IconComponent = ProductIcon || Icons__namespace[index$1.uppercamelcase(name)];
|
|
46
48
|
return /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread(_objectSpread({
|
|
47
|
-
className: "bg-background text-foreground border-border hover:ring-border inline-flex items-center gap-1.5 rounded-md border px-2 py-1.5 text-sm font-normal no-underline transition-all duration-300 select-none hover:ring-1 hover:ring-inset motion-reduce:transition-none",
|
|
48
49
|
"data-testid": "made-with-".concat(name.toLowerCase()),
|
|
49
50
|
href: "https://www.neeto.com/".concat(name.toLowerCase(), "?").concat(utmParams),
|
|
50
51
|
rel: "noreferrer",
|
|
51
|
-
target: "_blank"
|
|
52
|
+
target: "_blank",
|
|
53
|
+
className: classnames("neeto-molecules-made-with__wrapper", "bg-background text-foreground border-border hover:ring-border inline-flex items-center gap-1.5 rounded-md border px-2 py-1.5 text-sm font-normal no-underline transition-all duration-300 select-none hover:ring-1 hover:ring-inset motion-reduce:transition-none", className)
|
|
52
54
|
}, otherProps), {}, {
|
|
53
55
|
children: [IconComponent && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54
56
|
"data-testid": "made-with-".concat(name.toLowerCase(), "-icon"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MadeWith.js","sources":["../../../src/v2/components/MadeWith/index.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Typography } from \"@bigbinary/neeto-atoms\";\nimport { capitalize } from \"neetocist\";\nimport { globalProps } from \"neetocommons/v2/initializers\";\nimport * as Icons from \"neetoicons/logos\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\nimport uppercamelcase from \"uppercamelcase\";\n\nconst MadeWith = ({
|
|
1
|
+
{"version":3,"file":"MadeWith.js","sources":["../../../src/v2/components/MadeWith/index.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Typography } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { capitalize } from \"neetocist\";\nimport { globalProps } from \"neetocommons/v2/initializers\";\nimport * as Icons from \"neetoicons/logos\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\nimport uppercamelcase from \"uppercamelcase\";\n\nconst MadeWith = ({\n productName,\n productIcon: ProductIcon,\n className,\n ...otherProps\n}) => {\n const name = capitalize(productName || globalProps.appName || \"Neeto\");\n const subdomain = globalProps.organization?.subdomain;\n const utmParams = `utm_source=madewith${\n subdomain ? `&utm_campaign=${subdomain}` : \"\"\n }`;\n\n const IconComponent = ProductIcon || Icons[uppercamelcase(name)];\n\n return (\n <a\n data-testid={`made-with-${name.toLowerCase()}`}\n href={`https://www.neeto.com/${name.toLowerCase()}?${utmParams}`}\n rel=\"noreferrer\"\n target=\"_blank\"\n className={classnames(\n \"neeto-molecules-made-with__wrapper\",\n \"bg-background text-foreground border-border hover:ring-border inline-flex items-center gap-1.5 rounded-md border px-2 py-1.5 text-sm font-normal no-underline transition-all duration-300 select-none hover:ring-1 hover:ring-inset motion-reduce:transition-none\",\n className\n )}\n {...otherProps}\n >\n {IconComponent && (\n <span data-testid={`made-with-${name.toLowerCase()}-icon`}>\n <IconComponent size={14} />\n </span>\n )}\n <Typography className=\"leading-snug\" variant=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.common.madeWith\"\n values={{ productName: name }}\n />\n </Typography>\n </a>\n );\n};\n\nMadeWith.propTypes = {\n /**\n * Product name to be displayed on the component (optional).\n */\n productName: PropTypes.string,\n\n /**\n * Product icon component to be displayed on the badge (optional).\n */\n productIcon: PropTypes.elementType,\n\n /**\n * Additional class names to merge onto the badge root (optional).\n */\n className: PropTypes.string,\n};\n\nexport default memo(MadeWith);\n"],"names":["MadeWith","_ref","_globalProps$organiza","productName","ProductIcon","productIcon","className","otherProps","_objectWithoutProperties","_excluded","name","capitalize","globalProps","appName","subdomain","organization","utmParams","concat","IconComponent","Icons","uppercamelcase","_jsxs","_objectSpread","toLowerCase","href","rel","target","classnames","children","_jsx","size","Typography","variant","Trans","i18nKey","values","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAKR;AAAA,EAAA,IAAAC,qBAAA;AAAA,EAAA,IAJJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACEC,WAAW,GAAAH,IAAA,CAAxBI,WAAW;IACXC,SAAS,GAAAL,IAAA,CAATK,SAAS;AACNC,IAAAA,UAAU,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA;EAEb,IAAMC,IAAI,GAAGC,oBAAU,CAACR,WAAW,IAAIS,wBAAW,CAACC,OAAO,IAAI,OAAO,CAAC;AACtE,EAAA,IAAMC,SAAS,GAAA,CAAAZ,qBAAA,GAAGU,wBAAW,CAACG,YAAY,MAAA,IAAA,IAAAb,qBAAA,KAAA,MAAA,GAAA,MAAA,GAA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AAA,CACZ,CAAC;AAER,CAAC;AAmBD,YAAA,aAAe0B,UAAI,CAACpC,QAAQ,CAAC;;;;"}
|
|
@@ -5,21 +5,21 @@ var React = require('react');
|
|
|
5
5
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
7
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
8
|
-
var
|
|
8
|
+
var i18next = require('i18next');
|
|
9
9
|
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
10
|
-
var classnames = require('classnames');
|
|
11
|
-
var ramda = require('ramda');
|
|
12
10
|
var reactI18next = require('react-i18next');
|
|
13
|
-
var i18next = require('i18next');
|
|
14
11
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
15
12
|
var v2_HelpPopover = require('./HelpPopover.js');
|
|
16
13
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/v2/react-utils');
|
|
17
14
|
var zustand = require('zustand');
|
|
15
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
18
16
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
17
|
+
var ramda = require('ramda');
|
|
19
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
20
19
|
var trash2 = require('../trash-2-Dic3f2Hq.js');
|
|
21
20
|
var plus = require('../plus-B3N_9NiI.js');
|
|
22
21
|
var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
|
|
22
|
+
var classnames = require('classnames');
|
|
23
23
|
var v2_Codeblock = require('./Codeblock.js');
|
|
24
24
|
var initializers = require('@bigbinary/neeto-commons-frontend/v2/initializers');
|
|
25
25
|
var v2_BrowserPreview = require('./BrowserPreview.js');
|
|
@@ -1856,7 +1856,8 @@ var ProductEmbed = function ProductEmbed(_ref) {
|
|
|
1856
1856
|
var _useLocation = reactRouterDom.useLocation(),
|
|
1857
1857
|
search = _useLocation.search;
|
|
1858
1858
|
var queryParams = new URLSearchParams(search);
|
|
1859
|
-
var
|
|
1859
|
+
var typeFromQueryParams = toCamelCasedString(queryParams.get("type"));
|
|
1860
|
+
var selectedEmbed = Object.values(EMBED_OPTIONS).includes(typeFromQueryParams) && Object.keys(options).includes(typeFromQueryParams) ? typeFromQueryParams : undefined;
|
|
1860
1861
|
var _useProductEmbedStore = useProductEmbedStore(shallow.useShallow(function (store) {
|
|
1861
1862
|
return {
|
|
1862
1863
|
setProductEmbedState: store["setProductEmbedState"]
|