@teambit/schema 1.0.141 → 1.0.143
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/artifacts/__bit_junit.xml +4 -4
- package/artifacts/preview/teambit_semantics_schema-preview.js +1 -1
- package/dist/mock/button/button.composition.d.ts +2 -1
- package/dist/mock/button/index.d.ts +1 -1
- package/dist/{preview-1705720522529.js → preview-1706194779559.js} +3 -3
- package/dist/schema.composition.d.ts +1 -0
- package/dist/schema.service.d.ts +1 -1
- package/dist/schema.spec.js +30 -12
- package/dist/schema.spec.js.map +1 -1
- package/package.json +19 -17
- package/tsconfig.json +4 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites>
|
|
3
|
-
<testsuite name="teambit.semantics/schema@1.0.
|
|
4
|
-
<testcase classname="schema.spec.js" name="should be able to generate JSON object with all schemas" time="0.
|
|
5
|
-
<testcase classname="schema.spec.js" name="should be able to deserialize an JSON object to SchemaNode instances" time="0.
|
|
6
|
-
<testcase classname="schema.spec.js" name="should not throw when it does not recognize the schema" time="0.001"/>
|
|
3
|
+
<testsuite name="teambit.semantics/schema@1.0.143" tests="3" failures="0" errors="0" skipped="0">
|
|
4
|
+
<testcase classname="dist/schema.spec.js" name="should be able to generate JSON object with all schemas" time="0.012"/>
|
|
5
|
+
<testcase classname="dist/schema.spec.js" name="should be able to deserialize an JSON object to SchemaNode instances" time="0.008"/>
|
|
6
|
+
<testcase classname="dist/schema.spec.js" name="should not throw when it does not recognize the schema" time="0.001"/>
|
|
7
7
|
</testsuite>
|
|
8
8
|
</testsuites>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see teambit_semantics_schema-preview.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.semantics/schema-preview"]=t():e["teambit.semantics/schema-preview"]=t()}(self,(()=>(()=>{var e={10401:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},51041:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((r=e[i])||null!=r&&!isNaN(r)||(r=""),i=o(i),r=o(r),null===i||null===r)continue;a.push(i+"="+r)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var i=r(t[1]),a=r(t[2]);null===i||null===a||i in o||(o[i]=a)}return o}},71386:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},93800:(e,t,n)=>{"use strict";var r=n(71386),o=n(51041),i=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,a=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function c(e){return(e||"").toString().replace(s,"")}var u=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||r);if("blob:"===e.protocol)o=new d(unescape(e.pathname),{});else if("string"===a)for(t in o=new d(e,{}),l)delete o[t];else if("object"===a){for(t in e)t in l||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function f(e){e=c(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function d(e,t,n){if(e=c(e),!(this instanceof d))return new d(e,t,n);var i,a,s,l,m,h,b=u.slice(),v=typeof t,_=this,y=0;for("object"!==v&&"string"!==v&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),i=!(a=f(e||"")).protocol&&!a.slashes,_.slashes=a.slashes||i&&t.slashes,_.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(b[3]=[/(.*)/,"pathname"]);y<b.length;y++)"function"!=typeof(l=b[y])?(s=l[0],h=l[1],s!=s?_[h]=e:"string"==typeof s?~(m=e.indexOf(s))&&("number"==typeof l[2]?(_[h]=e.slice(0,m),e=e.slice(m+l[2])):(_[h]=e.slice(m),e=e.slice(0,m))):(m=s.exec(e))&&(_[h]=m[1],e=e.slice(0,m.index)),_[h]=_[h]||i&&l[3]&&t[h]||"",l[4]&&(_[h]=_[h].toLowerCase())):e=l(e);n&&(_.query=n(_.query)),i&&t.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==t.pathname)&&(_.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(_.pathname,t.pathname)),"/"!==_.pathname.charAt(0)&&_.hostname&&(_.pathname="/"+_.pathname),r(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(l=_.auth.split(":"),_.username=l[0]||"",_.password=l[1]||""),_.origin=_.protocol&&_.host&&"file:"!==_.protocol?_.protocol+"//"+_.host:"null",_.href=_.toString()}d.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<u.length;s++){var c=u[s];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},d.extractProtocol=f,d.location=p,d.trimLeft=c,d.qs=o,e.exports=d},36139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationProvider=t.useNavigation=t.useNavigate=t.useLocation=t.Link=void 0;var r=n(12845);Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return r.Link}});var o=n(65195);Object.defineProperty(t,"useLocation",{enumerable:!0,get:function(){return o.useLocation}});var i=n(77906);Object.defineProperty(t,"useNavigate",{enumerable:!0,get:function(){return i.useNavigate}});var a=n(77690);Object.defineProperty(t,"useNavigation",{enumerable:!0,get:function(){return a.useNavigation}}),Object.defineProperty(t,"NavigationProvider",{enumerable:!0,get:function(){return a.NavigationProvider}})},12845:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;const a=i(n(87363)),s=n(77690),c=n(1414);t.Link=(0,a.forwardRef)((function(e,t){const n=(0,s.useNavigation)().Link||c.NativeLink;return e.native||e.external?a.default.createElement(c.NativeLink,Object.assign({},e,{ref:t})):a.default.createElement(n,Object.assign({},e,{ref:t}))}))},1414:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;const c=i(n(87363)),u=s(n(10401)),l=n(83192),p=n(65195),f={rel:"noopener",target:"_blank"};t.NativeLink=(0,c.forwardRef)((function(e,t){var{className:n,style:r,activeClassName:o,activeStyle:i,active:s,strict:d,exact:m,href:h,external:b,native:v,state:_}=e,y=a(e,["className","style","activeClassName","activeStyle","active","strict","exact","href","external","native","state"]);const g=(0,p.useLocation)(),O=!!o||!!i,j=(0,c.useMemo)((()=>!!O&&("boolean"==typeof s?s:!(!g||!h)&&(0,l.compareUrl)(g.pathname,h,{exact:m,strict:d}))),[s,h,g,O]),w=b?f:{},x=(0,c.useMemo)((()=>j&&i?Object.assign(Object.assign({},r),i):r),[j,r]);return c.default.createElement("a",Object.assign({},w,y,{ref:t,href:h,className:(0,u.default)(n,j&&o),style:x}))}))},77690:function(e,t,n){"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationProvider=t.useNavigation=t.NavigationContext=void 0;const s=a(n(87363));function c(){return(0,s.useContext)(t.NavigationContext)}function u({children:e,implementation:n}){return s.default.createElement(t.NavigationContext.Provider,{value:n},e)}t.NavigationContext=s.default.createContext({}),c.__bit_component=r,t.useNavigation=c,u.__bit_component=r,t.NavigationProvider=u},65195:(e,t,n)=>{"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=void 0;const o=n(77690);function i(){return((0,o.useNavigation)().useLocation||a)()}function a(){if("undefined"!=typeof window)return window.location}i.__bit_component=r,t.useLocation=i,a.__bit_component=r},77906:(e,t,n)=>{"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.useNavigate=void 0;const o=n(77690);function i(){var e;const t=(0,o.useNavigation)();return(null===(e=t.useNavigate)||void 0===e?void 0:e.call(t))||a}function a(e,{replace:t}={}){if("undefined"==typeof window)throw new Error("base-react.navigation.use-location - cannot use native navigator outside of browser. Inject a custom useNavigate, or use navigation after mount");const{location:n,history:r}=window;"number"==typeof e?r.go(e):t?n.replace(e):n.assign(e)}i.__bit_component=r,t.useNavigate=i,a.__bit_component=r},83697:function(e,t,n){"use strict";var r={id:"teambit.base-ui/routing/compare-url@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/compare-url",exported:!0},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;const i=o(n(93800));function a(e,t,{exact:n,strict:r}={}){if(e===t)return!0;r||(e=e.replace(/\/(?=[?#]|$)/,""),t=t.replace(/\/(?=[?#]|$)/,""));const o=i.default(e),a=i.default(t),l=s(o,a),p=!n||c(o,a),f=!r||u(o,a);return l&&p&&f}function s(e,t){return(!t.protocol||t.protocol===e.protocol)&&(!t.hostname||t.hostname===e.hostname)&&(!t.port||t.port===e.port)&&(!t.pathname||e.pathname.startsWith(t.pathname))&&(!t.query||l(t.query,e.query))&&(!t.hash||t.hash===e.hash)&&(!t.password||t.password===e.password)&&(!t.username||t.username===e.username)}function c(e,t){return(!t.pathname||e.pathname===t.pathname)&&(!t.query||l(e.query,t.query))}function u(e,t){return!t.pathname||e.pathname.endsWith("/")===t.pathname.endsWith("/")}function l(e,t){return Object.keys(e).every((n=>e[n]===t[n]))}a.__bit_component=r,t.compareUrl=a,s.__bit_component=r,c.__bit_component=r,u.__bit_component=r,l.__bit_component=r},83192:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;var r=n(83697);Object.defineProperty(t,"compareUrl",{enumerable:!0,get:function(){return r.compareUrl}})},26704:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.141",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=a(n(87363));return o=function(){return e},e}function i(){const e=n(31422);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonWithIcon=t.ButtonWithCustomStyles=t.ButtonAsALink=t.BasicButton=void 0,t.Footer=c,o.__bit_component=r,i.__bit_component=r,a.__bit_component=r;const s=()=>o().default.createElement(i().Button,null,"click me");function c({children:e=o().default.createElement(s,null)}){return o().default.createElement(i().Button,null,e)}s.__bit_component=r,t.BasicButton=s,c.__bit_component=r;const u=()=>o().default.createElement(i().Button,{style:{background:"red"}},"click me");u.__bit_component=r,t.ButtonWithCustomStyles=u;const l=()=>o().default.createElement(i().Button,null,"click me");l.__bit_component=r,t.ButtonWithIcon=l;const p=()=>o().default.createElement(i().Button,{href:"https://bit.dev"},"Bit");p.__bit_component=r,t.ButtonAsALink=p},31422:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.141",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=s(n(87363));return o=function(){return e},e}function i(){const e=n(36139);return i=function(){return e},e}function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=d(e,"string");return"symbol"==typeof t?t:String(t)}function d(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){const t=(0,o().useRef)(),n=l({},e),r=e.href?.startsWith("http:")||e.href?.startsWith("https:");return o().default.createElement(o().default.Fragment,null,e.href?o().default.createElement(i().Link,c({external:r,ref:t,className:e.className},n),e.children):o().default.createElement("button",c({className:e.className,ref:t},n),e.children))}Object.defineProperty(t,"__esModule",{value:!0}),t.Bar=void 0,t.Button=m,o.__bit_component=r,i.__bit_component=r,a.__bit_component=r,s.__bit_component=r,c.__bit_component=r,u.__bit_component=r,l.__bit_component=r,p.__bit_component=r,f.__bit_component=r,d.__bit_component=r,m.__bit_component=r,t.Bar=class{foo(){}}},50966:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.141",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=i(n(87363));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,o.__bit_component=r,i.__bit_component=r;const a=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/code.svg"}));a.__bit_component=r,t.Logo=a},87363:e=>{"use strict";e.exports=React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{compositions:()=>f,compositions_metadata:()=>m,overview:()=>d});var e={};n.r(e),n.d(e,{default:()=>p});var t=n(50966),o=n(26704);n(87363);const i=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var s=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u={},l="wrapper";function p(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,s);return(0,i.mdx)(l,c({},u,n,{components:t,mdxType:"MDXLayout"}),(0,i.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}p.isMDXComponent=!0;const f=[t,o],d=[e],m={compositions:[{displayName:"Logo",identifier:"Logo"},{displayName:"Basic button",identifier:"BasicButton"},{displayName:"Footer",identifier:"Footer"},{displayName:"Button with custom styles",identifier:"ButtonWithCustomStyles"},{displayName:"Button with icon",identifier:"ButtonWithIcon"},{displayName:"Button as a link",identifier:"ButtonAsALink"}]}})(),r})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.semantics/schema-preview"]=t():e["teambit.semantics/schema-preview"]=t()}(self,(()=>(()=>{var e={10401:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},51041:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((r=e[i])||null!=r&&!isNaN(r)||(r=""),i=o(i),r=o(r),null===i||null===r)continue;a.push(i+"="+r)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var i=r(t[1]),a=r(t[2]);null===i||null===a||i in o||(o[i]=a)}return o}},71386:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},93800:(e,t,n)=>{"use strict";var r=n(71386),o=n(51041),i=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,a=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function c(e){return(e||"").toString().replace(s,"")}var u=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||r);if("blob:"===e.protocol)o=new d(unescape(e.pathname),{});else if("string"===a)for(t in o=new d(e,{}),l)delete o[t];else if("object"===a){for(t in e)t in l||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function f(e){e=c(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function d(e,t,n){if(e=c(e),!(this instanceof d))return new d(e,t,n);var i,a,s,l,m,h,b=u.slice(),v=typeof t,_=this,y=0;for("object"!==v&&"string"!==v&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),i=!(a=f(e||"")).protocol&&!a.slashes,_.slashes=a.slashes||i&&t.slashes,_.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(b[3]=[/(.*)/,"pathname"]);y<b.length;y++)"function"!=typeof(l=b[y])?(s=l[0],h=l[1],s!=s?_[h]=e:"string"==typeof s?~(m=e.indexOf(s))&&("number"==typeof l[2]?(_[h]=e.slice(0,m),e=e.slice(m+l[2])):(_[h]=e.slice(m),e=e.slice(0,m))):(m=s.exec(e))&&(_[h]=m[1],e=e.slice(0,m.index)),_[h]=_[h]||i&&l[3]&&t[h]||"",l[4]&&(_[h]=_[h].toLowerCase())):e=l(e);n&&(_.query=n(_.query)),i&&t.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==t.pathname)&&(_.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(_.pathname,t.pathname)),"/"!==_.pathname.charAt(0)&&_.hostname&&(_.pathname="/"+_.pathname),r(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(l=_.auth.split(":"),_.username=l[0]||"",_.password=l[1]||""),_.origin=_.protocol&&_.host&&"file:"!==_.protocol?_.protocol+"//"+_.host:"null",_.href=_.toString()}d.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<u.length;s++){var c=u[s];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},d.extractProtocol=f,d.location=p,d.trimLeft=c,d.qs=o,e.exports=d},43715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationProvider=t.useNavigation=t.useNavigate=t.useLocation=t.Link=void 0;var r=n(27136);Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return r.Link}});var o=n(34660);Object.defineProperty(t,"useLocation",{enumerable:!0,get:function(){return o.useLocation}});var i=n(89030);Object.defineProperty(t,"useNavigate",{enumerable:!0,get:function(){return i.useNavigate}});var a=n(27924);Object.defineProperty(t,"useNavigation",{enumerable:!0,get:function(){return a.useNavigation}}),Object.defineProperty(t,"NavigationProvider",{enumerable:!0,get:function(){return a.NavigationProvider}})},27136:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;const a=i(n(87363)),s=n(27924),c=n(7210);t.Link=(0,a.forwardRef)((function(e,t){const n=(0,s.useNavigation)().Link||c.NativeLink;return e.native||e.external?a.default.createElement(c.NativeLink,Object.assign({},e,{ref:t})):a.default.createElement(n,Object.assign({},e,{ref:t}))}))},7210:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;const c=i(n(87363)),u=s(n(10401)),l=n(1640),p=n(34660),f={rel:"noopener",target:"_blank"};t.NativeLink=(0,c.forwardRef)((function(e,t){var{className:n,style:r,activeClassName:o,activeStyle:i,active:s,strict:d,exact:m,href:h,external:b,native:v,state:_}=e,y=a(e,["className","style","activeClassName","activeStyle","active","strict","exact","href","external","native","state"]);const g=(0,p.useLocation)(),O=!!o||!!i,j=(0,c.useMemo)((()=>!!O&&("boolean"==typeof s?s:!(!g||!h)&&(0,l.compareUrl)(g.pathname,h,{exact:m,strict:d}))),[s,h,g,O]),w=b?f:{},x=(0,c.useMemo)((()=>j&&i?Object.assign(Object.assign({},r),i):r),[j,r]);return c.default.createElement("a",Object.assign({},w,y,{ref:t,href:h,className:(0,u.default)(n,j&&o),style:x}))}))},27924:function(e,t,n){"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationProvider=t.useNavigation=t.NavigationContext=void 0;const s=a(n(87363));function c(){return(0,s.useContext)(t.NavigationContext)}function u({children:e,implementation:n}){return s.default.createElement(t.NavigationContext.Provider,{value:n},e)}t.NavigationContext=s.default.createContext({}),c.__bit_component=r,t.useNavigation=c,u.__bit_component=r,t.NavigationProvider=u},34660:(e,t,n)=>{"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=void 0;const o=n(27924);function i(){return((0,o.useNavigation)().useLocation||a)()}function a(){if("undefined"!=typeof window)return window.location}i.__bit_component=r,t.useLocation=i,a.__bit_component=r},89030:(e,t,n)=>{"use strict";var r={id:"teambit.base-react/navigation/link@2.0.27",homepage:"https://bit.dev/teambit/base-react/navigation/link",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.useNavigate=void 0;const o=n(27924);function i(){var e;const t=(0,o.useNavigation)();return(null===(e=t.useNavigate)||void 0===e?void 0:e.call(t))||a}function a(e,{replace:t}={}){if("undefined"==typeof window)throw new Error("base-react.navigation.use-location - cannot use native navigator outside of browser. Inject a custom useNavigate, or use navigation after mount");const{location:n,history:r}=window;"number"==typeof e?r.go(e):t?n.replace(e):n.assign(e)}i.__bit_component=r,t.useNavigate=i,a.__bit_component=r},26366:function(e,t,n){"use strict";var r={id:"teambit.base-ui/routing/compare-url@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/compare-url",exported:!0},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;const i=o(n(93800));function a(e,t,{exact:n,strict:r}={}){if(e===t)return!0;r||(e=e.replace(/\/(?=[?#]|$)/,""),t=t.replace(/\/(?=[?#]|$)/,""));const o=i.default(e),a=i.default(t),l=s(o,a),p=!n||c(o,a),f=!r||u(o,a);return l&&p&&f}function s(e,t){return(!t.protocol||t.protocol===e.protocol)&&(!t.hostname||t.hostname===e.hostname)&&(!t.port||t.port===e.port)&&(!t.pathname||e.pathname.startsWith(t.pathname))&&(!t.query||l(t.query,e.query))&&(!t.hash||t.hash===e.hash)&&(!t.password||t.password===e.password)&&(!t.username||t.username===e.username)}function c(e,t){return(!t.pathname||e.pathname===t.pathname)&&(!t.query||l(e.query,t.query))}function u(e,t){return!t.pathname||e.pathname.endsWith("/")===t.pathname.endsWith("/")}function l(e,t){return Object.keys(e).every((n=>e[n]===t[n]))}a.__bit_component=r,t.compareUrl=a,s.__bit_component=r,c.__bit_component=r,u.__bit_component=r,l.__bit_component=r},1640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;var r=n(26366);Object.defineProperty(t,"compareUrl",{enumerable:!0,get:function(){return r.compareUrl}})},21428:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.143",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=a(n(87363));return o=function(){return e},e}function i(){const e=n(96717);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonWithIcon=t.ButtonWithCustomStyles=t.ButtonAsALink=t.BasicButton=void 0,t.Footer=c,o.__bit_component=r,i.__bit_component=r,a.__bit_component=r;const s=()=>o().default.createElement(i().Button,null,"click me");function c({children:e=o().default.createElement(s,null)}){return o().default.createElement(i().Button,null,e)}s.__bit_component=r,t.BasicButton=s,c.__bit_component=r;const u=()=>o().default.createElement(i().Button,{style:{background:"red"}},"click me");u.__bit_component=r,t.ButtonWithCustomStyles=u;const l=()=>o().default.createElement(i().Button,null,"click me");l.__bit_component=r,t.ButtonWithIcon=l;const p=()=>o().default.createElement(i().Button,{href:"https://bit.dev"},"Bit");p.__bit_component=r,t.ButtonAsALink=p},96717:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.143",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=s(n(87363));return o=function(){return e},e}function i(){const e=n(43715);return i=function(){return e},e}function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=d(e,"string");return"symbol"==typeof t?t:String(t)}function d(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){const t=(0,o().useRef)(),n=l({},e),r=e.href?.startsWith("http:")||e.href?.startsWith("https:");return o().default.createElement(o().default.Fragment,null,e.href?o().default.createElement(i().Link,c({external:r,ref:t,className:e.className},n),e.children):o().default.createElement("button",c({className:e.className,ref:t},n),e.children))}Object.defineProperty(t,"__esModule",{value:!0}),t.Bar=void 0,t.Button=m,o.__bit_component=r,i.__bit_component=r,a.__bit_component=r,s.__bit_component=r,c.__bit_component=r,u.__bit_component=r,l.__bit_component=r,p.__bit_component=r,f.__bit_component=r,d.__bit_component=r,m.__bit_component=r,t.Bar=class{foo(){}}},9628:(e,t,n)=>{"use strict";var r={id:"teambit.semantics/schema@1.0.143",homepage:"https://bit.cloud/teambit/semantics/schema",exported:!0};function o(){const e=i(n(87363));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,o.__bit_component=r,i.__bit_component=r;const a=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/code.svg"}));a.__bit_component=r,t.Logo=a},87363:e=>{"use strict";e.exports=React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{compositions:()=>f,compositions_metadata:()=>m,overview:()=>d});var e={};n.r(e),n.d(e,{default:()=>p});var t=n(9628),o=n(21428);n(87363);const i=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var s=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u={},l="wrapper";function p(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,s);return(0,i.mdx)(l,c({},u,n,{components:t,mdxType:"MDXLayout"}),(0,i.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}p.isMDXComponent=!0;const f=[t,o],d=[e],m={compositions:[{displayName:"Logo",identifier:"Logo"},{displayName:"Basic button",identifier:"BasicButton"},{displayName:"Footer",identifier:"Footer"},{displayName:"Button with custom styles",identifier:"ButtonWithCustomStyles"},{displayName:"Button with icon",identifier:"ButtonWithIcon"},{displayName:"Button as a link",identifier:"ButtonAsALink"}]}})(),r})()));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const BasicButton: () => JSX.Element;
|
|
2
3
|
/**
|
|
3
4
|
* example of passing a JSX Element as a parameter
|
|
4
5
|
*/
|
|
5
6
|
export declare function Footer({ children }: {
|
|
6
|
-
children?: JSX.Element;
|
|
7
|
+
children?: JSX.Element | undefined;
|
|
7
8
|
}): JSX.Element;
|
|
8
9
|
export declare const ButtonWithCustomStyles: () => JSX.Element;
|
|
9
10
|
export declare const ButtonWithIcon: () => JSX.Element;
|
|
@@ -59,7 +59,7 @@ export type ParenthesizedType = (T1 | T2)[];
|
|
|
59
59
|
export declare function typePredicateFn(str: any): str is string;
|
|
60
60
|
export declare function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition;
|
|
61
61
|
export declare function objectBindingElements({ prop }: {
|
|
62
|
-
prop?: number;
|
|
62
|
+
prop?: number | undefined;
|
|
63
63
|
}): Promise<number>;
|
|
64
64
|
export declare function arrayBindingElements([prop]: [string]): Promise<string>;
|
|
65
65
|
interface config {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.
|
|
2
|
-
import * as compositions_1 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.
|
|
3
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.143/dist/schema.composition.js';
|
|
2
|
+
import * as compositions_1 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.143/dist/mock/button/button.composition.js';
|
|
3
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@1.0.143/dist/schema.docs.mdx';
|
|
4
4
|
|
|
5
5
|
export const compositions = [compositions_0, compositions_1];
|
|
6
6
|
export const overview = [overview_0];
|
package/dist/schema.service.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type SchemaTransformationMap = ServiceTransformationMap & {
|
|
|
6
6
|
export declare class SchemaService implements EnvService<{}> {
|
|
7
7
|
name: string;
|
|
8
8
|
run(context: ExecutionContext): Promise<{
|
|
9
|
-
errors:
|
|
9
|
+
errors: never[];
|
|
10
10
|
context: ExecutionContext;
|
|
11
11
|
}>;
|
|
12
12
|
transform(env: Env, context: EnvContext): SchemaTransformationMap | undefined;
|
package/dist/schema.spec.js
CHANGED
|
@@ -14,6 +14,13 @@ function _fsExtra() {
|
|
|
14
14
|
};
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
|
+
function _chai() {
|
|
18
|
+
const data = _interopRequireWildcard(require("chai"));
|
|
19
|
+
_chai = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
17
24
|
function _semanticsEntities() {
|
|
18
25
|
const data = require("@teambit/semantics.entities.semantic-schema");
|
|
19
26
|
_semanticsEntities = function () {
|
|
@@ -21,6 +28,13 @@ function _semanticsEntities() {
|
|
|
21
28
|
};
|
|
22
29
|
return data;
|
|
23
30
|
}
|
|
31
|
+
function _chaiSubset() {
|
|
32
|
+
const data = _interopRequireDefault(require("chai-subset"));
|
|
33
|
+
_chaiSubset = function () {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
24
38
|
function _tracker() {
|
|
25
39
|
const data = _interopRequireDefault(require("@teambit/tracker"));
|
|
26
40
|
_tracker = function () {
|
|
@@ -63,12 +77,16 @@ function _() {
|
|
|
63
77
|
};
|
|
64
78
|
return data;
|
|
65
79
|
}
|
|
80
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
81
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
66
82
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
+
_chai().default.use(_chaiSubset().default);
|
|
67
84
|
describe('SchemaAspect', function () {
|
|
85
|
+
this.timeout(0);
|
|
68
86
|
let schema;
|
|
69
87
|
let workspace;
|
|
70
88
|
let workspaceData;
|
|
71
|
-
|
|
89
|
+
before(async () => {
|
|
72
90
|
workspaceData = (0, _workspaceTesting().mockWorkspace)();
|
|
73
91
|
const {
|
|
74
92
|
workspacePath
|
|
@@ -76,13 +94,13 @@ describe('SchemaAspect', function () {
|
|
|
76
94
|
// eslint-disable-next-line no-console
|
|
77
95
|
console.log('workspace created at ', workspacePath);
|
|
78
96
|
schema = await (0, _harmonyTesting().loadAspect)(_().SchemaAspect, workspacePath);
|
|
79
|
-
}
|
|
80
|
-
|
|
97
|
+
});
|
|
98
|
+
after(async () => {
|
|
81
99
|
await (0, _workspaceTesting().destroyWorkspace)(workspaceData);
|
|
82
100
|
});
|
|
83
101
|
describe('getSchema()', () => {
|
|
84
102
|
let apiSchema;
|
|
85
|
-
|
|
103
|
+
before(async () => {
|
|
86
104
|
const {
|
|
87
105
|
workspacePath
|
|
88
106
|
} = workspaceData;
|
|
@@ -101,7 +119,7 @@ describe('SchemaAspect', function () {
|
|
|
101
119
|
const compId = await workspace.resolveComponentId('button');
|
|
102
120
|
const comp = await workspace.get(compId);
|
|
103
121
|
apiSchema = await schema.getSchema(comp, true);
|
|
104
|
-
}
|
|
122
|
+
});
|
|
105
123
|
it('should be able to generate JSON object with all schemas', async () => {
|
|
106
124
|
const results = apiSchema.toObject();
|
|
107
125
|
const expectedJsonPath = _path().default.join(getMockDir(), 'button-schemas.json');
|
|
@@ -109,7 +127,7 @@ describe('SchemaAspect', function () {
|
|
|
109
127
|
// fs.outputFileSync(expectedJsonPath, JSON.stringify(results, undefined, 2));
|
|
110
128
|
const expectedJson = _fsExtra().default.readJsonSync(expectedJsonPath);
|
|
111
129
|
// @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.
|
|
112
|
-
expect(results).
|
|
130
|
+
(0, _chai().expect)(results).to.to.containSubset(expectedJson);
|
|
113
131
|
});
|
|
114
132
|
});
|
|
115
133
|
describe('getSchemaFromObject', () => {
|
|
@@ -117,19 +135,19 @@ describe('SchemaAspect', function () {
|
|
|
117
135
|
const jsonPath = _path().default.join(getMockDir(), 'button-schemas.json');
|
|
118
136
|
const json = _fsExtra().default.readJsonSync(jsonPath);
|
|
119
137
|
const apiSchema = schema.getSchemaFromObject(json);
|
|
120
|
-
expect(apiSchema instanceof _semanticsEntities().APISchema).
|
|
121
|
-
expect(apiSchema.componentId.constructor.name).
|
|
138
|
+
(0, _chai().expect)(apiSchema instanceof _semanticsEntities().APISchema).to.be.true;
|
|
139
|
+
(0, _chai().expect)(apiSchema.componentId.constructor.name).to.equal(_componentId().ComponentID.name);
|
|
122
140
|
// @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.
|
|
123
|
-
expect(apiSchema.toObject()).
|
|
141
|
+
(0, _chai().expect)(apiSchema.toObject()).to.containSubset(json);
|
|
124
142
|
});
|
|
125
143
|
it('should not throw when it does not recognize the schema', () => {
|
|
126
144
|
const jsonPath = _path().default.join(getMockDir(), 'button-old-schema.json');
|
|
127
145
|
const json = _fsExtra().default.readJsonSync(jsonPath);
|
|
128
146
|
const apiSchema = schema.getSchemaFromObject(json);
|
|
129
|
-
expect(apiSchema instanceof _semanticsEntities().APISchema).
|
|
130
|
-
expect(apiSchema.module.exports[0] instanceof _semanticsEntities().UnknownSchema).
|
|
147
|
+
(0, _chai().expect)(apiSchema instanceof _semanticsEntities().APISchema).to.be.true;
|
|
148
|
+
(0, _chai().expect)(apiSchema.module.exports[0] instanceof _semanticsEntities().UnknownSchema).to.be.true;
|
|
131
149
|
// @ts-ignore
|
|
132
|
-
expect(apiSchema.module.exports[0].location).
|
|
150
|
+
(0, _chai().expect)(apiSchema.module.exports[0].location).to.deep.equal({
|
|
133
151
|
file: 'index.ts',
|
|
134
152
|
line: 21,
|
|
135
153
|
character: 14
|
package/dist/schema.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_fsExtra","_semanticsEntities","_tracker","_harmonyTesting","_workspaceTesting","_componentId","_workspace","_","obj","__esModule","default","describe","schema","workspace","workspaceData","beforeAll","mockWorkspace","workspacePath","console","log","loadAspect","SchemaAspect","afterAll","destroyWorkspace","apiSchema","compDir","path","join","src","getMockDir","fs","copy","harmony","loadManyAspects","WorkspaceAspect","TrackerAspect","get","id","tracker","track","rootDir","defaultScope","bitMap","write","compId","resolveComponentId","comp","getSchema","it","results","toObject","expectedJsonPath","expectedJson","readJsonSync","expect","toMatchObject","jsonPath","json","getSchemaFromObject","APISchema","toEqual","componentId","constructor","name","ComponentID","module","exports","UnknownSchema","location","file","line","character","getCurrentDir","currentDir","__dirname","endsWith","sep","slice"],"sources":["schema.spec.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\nimport { APISchema, UnknownSchema } from '@teambit/semantics.entities.semantic-schema';\nimport TrackerAspect, { TrackerMain } from '@teambit/tracker';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { SchemaMain } from './schema.main.runtime';\nimport { SchemaAspect } from '.';\n\ndescribe('SchemaAspect', function () {\n let schema: SchemaMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n beforeAll(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n schema = await loadAspect(SchemaAspect, workspacePath);\n }, 30000);\n afterAll(async () => {\n await destroyWorkspace(workspaceData);\n });\n describe('getSchema()', () => {\n let apiSchema: APISchema;\n beforeAll(async () => {\n const { workspacePath } = workspaceData;\n const compDir = path.join(workspacePath, 'button');\n const src = path.join(getMockDir(), 'button');\n await fs.copy(src, compDir);\n const harmony = await loadManyAspects([WorkspaceAspect, SchemaAspect, TrackerAspect], workspacePath);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n const tracker = harmony.get<TrackerMain>(TrackerAspect.id);\n await tracker.track({ rootDir: compDir, defaultScope: 'org.scope' });\n await workspace.bitMap.write();\n schema = harmony.get<SchemaMain>(SchemaAspect.id);\n const compId = await workspace.resolveComponentId('button');\n const comp = await workspace.get(compId);\n apiSchema = await schema.getSchema(comp, true);\n }, 30000);\n it('should be able to generate JSON object with all schemas', async () => {\n const results = apiSchema.toObject();\n const expectedJsonPath = path.join(getMockDir(), 'button-schemas.json');\n // uncomment the next line temporarily to sync the expected json with new schema changes\n // fs.outputFileSync(expectedJsonPath, JSON.stringify(results, undefined, 2));\n const expectedJson = fs.readJsonSync(expectedJsonPath);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(results).toMatchObject(expectedJson);\n });\n });\n describe('getSchemaFromObject', () => {\n it('should be able to deserialize an JSON object to SchemaNode instances', () => {\n const jsonPath = path.join(getMockDir(), 'button-schemas.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).toEqual(true);\n expect(apiSchema.componentId.constructor.name).toEqual(ComponentID.name);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(apiSchema.toObject()).toMatchObject(json);\n });\n it('should not throw when it does not recognize the schema', () => {\n const jsonPath = path.join(getMockDir(), 'button-old-schema.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).toEqual(true);\n expect(apiSchema.module.exports[0] instanceof UnknownSchema).toEqual(true);\n // @ts-ignore\n expect(apiSchema.module.exports[0].location).toMatchObject({ file: 'index.ts', line: 21, character: 14 });\n });\n });\n});\n\nfunction getCurrentDir() {\n const currentDir = __dirname;\n if (currentDir.endsWith(`${path.sep}dist`)) return currentDir.slice(0,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C,CAAC;EAC1E,OAAOJ,UAAU;AACnB;AAEA,SAAS5C,UAAUA,CAAA,EAAG;EACpB,OAAOH,eAAI,CAACC,IAAI,CAAC6C,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;AAC3C"}
|
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_fsExtra","_chai","_interopRequireWildcard","_semanticsEntities","_chaiSubset","_tracker","_harmonyTesting","_workspaceTesting","_componentId","_workspace","_","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","chai","use","chaiSubset","describe","timeout","schema","workspace","workspaceData","before","mockWorkspace","workspacePath","console","log","loadAspect","SchemaAspect","after","destroyWorkspace","apiSchema","compDir","path","join","src","getMockDir","fs","copy","harmony","loadManyAspects","WorkspaceAspect","TrackerAspect","id","tracker","track","rootDir","defaultScope","bitMap","write","compId","resolveComponentId","comp","getSchema","it","results","toObject","expectedJsonPath","expectedJson","readJsonSync","expect","to","containSubset","jsonPath","json","getSchemaFromObject","APISchema","be","true","componentId","constructor","name","equal","ComponentID","module","exports","UnknownSchema","location","deep","file","line","character","getCurrentDir","currentDir","__dirname","endsWith","sep","slice"],"sources":["schema.spec.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\nimport chai, { expect } from 'chai';\nimport { APISchema, UnknownSchema } from '@teambit/semantics.entities.semantic-schema';\nimport chaiSubset from 'chai-subset';\nimport TrackerAspect, { TrackerMain } from '@teambit/tracker';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { SchemaMain } from './schema.main.runtime';\nimport { SchemaAspect } from '.';\n\nchai.use(chaiSubset);\n\ndescribe('SchemaAspect', function () {\n this.timeout(0);\n let schema: SchemaMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n schema = await loadAspect(SchemaAspect, workspacePath);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n describe('getSchema()', () => {\n let apiSchema: APISchema;\n before(async () => {\n const { workspacePath } = workspaceData;\n const compDir = path.join(workspacePath, 'button');\n const src = path.join(getMockDir(), 'button');\n await fs.copy(src, compDir);\n const harmony = await loadManyAspects([WorkspaceAspect, SchemaAspect, TrackerAspect], workspacePath);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n const tracker = harmony.get<TrackerMain>(TrackerAspect.id);\n await tracker.track({ rootDir: compDir, defaultScope: 'org.scope' });\n await workspace.bitMap.write();\n schema = harmony.get<SchemaMain>(SchemaAspect.id);\n const compId = await workspace.resolveComponentId('button');\n const comp = await workspace.get(compId);\n apiSchema = await schema.getSchema(comp, true);\n });\n it('should be able to generate JSON object with all schemas', async () => {\n const results = apiSchema.toObject();\n const expectedJsonPath = path.join(getMockDir(), 'button-schemas.json');\n // uncomment the next line temporarily to sync the expected json with new schema changes\n // fs.outputFileSync(expectedJsonPath, JSON.stringify(results, undefined, 2));\n const expectedJson = fs.readJsonSync(expectedJsonPath);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(results).to.to.containSubset(expectedJson);\n });\n });\n describe('getSchemaFromObject', () => {\n it('should be able to deserialize an JSON object to SchemaNode instances', () => {\n const jsonPath = path.join(getMockDir(), 'button-schemas.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).to.be.true;\n expect(apiSchema.componentId.constructor.name).to.equal(ComponentID.name);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(apiSchema.toObject()).to.containSubset(json);\n });\n it('should not throw when it does not recognize the schema', () => {\n const jsonPath = path.join(getMockDir(), 'button-old-schema.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).to.be.true;\n expect(apiSchema.module.exports[0] instanceof UnknownSchema).to.be.true;\n // @ts-ignore\n expect(apiSchema.module.exports[0].location).to.deep.equal({ file: 'index.ts', line: 21, character: 14 });\n });\n });\n});\n\nfunction getCurrentDir() {\n const currentDir = __dirname;\n if (currentDir.endsWith(`${path.sep}dist`)) return currentDir.slice(0, -5);\n return currentDir;\n}\n\nfunction getMockDir() {\n return path.join(getCurrentDir(), 'mock');\n}\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAK,uBAAA,CAAAH,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,mBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,kBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EA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cAAM,EAAC7B,SAAS,YAAYmC,8BAAS,CAAC,CAACL,EAAE,CAACM,EAAE,CAACC,IAAI;MACjD,IAAAR,cAAM,EAAC7B,SAAS,CAAC2C,MAAM,CAACC,OAAO,CAAC,CAAC,CAAC,YAAYC,kCAAa,CAAC,CAACf,EAAE,CAACM,EAAE,CAACC,IAAI;MACvE;MACA,IAAAR,cAAM,EAAC7B,SAAS,CAAC2C,MAAM,CAACC,OAAO,CAAC,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAChB,EAAE,CAACiB,IAAI,CAACN,KAAK,CAAC;QAAEO,IAAI,EAAE,UAAU;QAAEC,IAAI,EAAE,EAAE;QAAEC,SAAS,EAAE;MAAG,CAAC,CAAC;IAC3G,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,SAASC,aAAaA,CAAA,EAAG;EACvB,MAAMC,UAAU,GAAGC,SAAS;EAC5B,IAAID,UAAU,CAACE,QAAQ,CAAE,GAAEpD,eAAI,CAACqD,GAAI,MAAK,CAAC,EAAE,OAAOH,UAAU,CAACI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC1E,OAAOJ,UAAU;AACnB;AAEA,SAAS/C,UAAUA,CAAA,EAAG;EACpB,OAAOH,eAAI,CAACC,IAAI,CAACgD,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;AAC3C"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.143",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/semantics/schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "schema",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.143"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"p-map-series": "2.1.0",
|
|
@@ -16,30 +16,31 @@
|
|
|
16
16
|
"@teambit/harmony": "0.4.6",
|
|
17
17
|
"@teambit/base-react.navigation.link": "2.0.27",
|
|
18
18
|
"@teambit/semantics.entities.semantic-schema": "0.0.66",
|
|
19
|
-
"@teambit/envs": "1.0.
|
|
20
|
-
"@teambit/component": "1.0.
|
|
21
|
-
"@teambit/formatter": "1.0.
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/logger": "0.0.
|
|
24
|
-
"@teambit/graphql": "1.0.
|
|
25
|
-
"@teambit/builder": "1.0.
|
|
19
|
+
"@teambit/envs": "1.0.143",
|
|
20
|
+
"@teambit/component": "1.0.143",
|
|
21
|
+
"@teambit/formatter": "1.0.143",
|
|
22
|
+
"@teambit/cli": "0.0.849",
|
|
23
|
+
"@teambit/logger": "0.0.942",
|
|
24
|
+
"@teambit/graphql": "1.0.143",
|
|
25
|
+
"@teambit/builder": "1.0.143",
|
|
26
26
|
"@teambit/defender.prettier.config-mutator": "0.0.96",
|
|
27
|
-
"@teambit/workspace": "1.0.
|
|
27
|
+
"@teambit/workspace": "1.0.143"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@types/chai": "4.2.15",
|
|
30
31
|
"@types/fs-extra": "9.0.7",
|
|
32
|
+
"chai-subset": "^1.6.0",
|
|
33
|
+
"chai": "4.3.0",
|
|
31
34
|
"@types/mocha": "9.1.0",
|
|
32
|
-
"@types/jest": "^29.2.2",
|
|
33
|
-
"@types/testing-library__jest-dom": "^5.9.5",
|
|
34
35
|
"@teambit/component-id": "1.2.0",
|
|
35
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
36
|
-
"@teambit/harmony.testing.load-aspect": "0.0.
|
|
37
|
-
"@teambit/tracker": "1.0.
|
|
36
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.24",
|
|
37
|
+
"@teambit/harmony.testing.load-aspect": "0.0.184",
|
|
38
|
+
"@teambit/tracker": "1.0.143",
|
|
38
39
|
"@teambit/workspace.testing.mock-workspace": "0.0.23"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"react": "^17.0.0 || ^18.0.0",
|
|
42
|
-
"@types/react": "17.0.
|
|
43
|
+
"@types/react": "^17.0.73",
|
|
43
44
|
"@teambit/legacy": "1.0.624"
|
|
44
45
|
},
|
|
45
46
|
"license": "Apache-2.0",
|
|
@@ -54,7 +55,8 @@
|
|
|
54
55
|
"default": "./dist/index.js"
|
|
55
56
|
},
|
|
56
57
|
"./dist/*": "./dist/*",
|
|
57
|
-
"./artifacts/*": "./artifacts/*"
|
|
58
|
+
"./artifacts/*": "./artifacts/*",
|
|
59
|
+
"./*": "./*.ts"
|
|
58
60
|
},
|
|
59
61
|
"private": false,
|
|
60
62
|
"engines": {
|
package/tsconfig.json
CHANGED
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
"resolveJsonModule": true,
|
|
18
18
|
"allowJs": true,
|
|
19
19
|
"outDir": "dist",
|
|
20
|
-
"emitDeclarationOnly": true
|
|
20
|
+
"emitDeclarationOnly": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"strictPropertyInitialization": false,
|
|
23
|
+
"noImplicitAny": false
|
|
21
24
|
},
|
|
22
25
|
"exclude": [
|
|
23
26
|
"artifacts",
|