@teambit/react.ui.component-highlighter 0.0.490 → 0.0.494

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.
Files changed (138) hide show
  1. package/{multi-highlighter/multi-highlighter.composition.tsx → children-highlighter/children-highlighter.composition.tsx} +27 -25
  2. package/{multi-highlighter/multi-highlighter.spec.tsx → children-highlighter/children-highlighter.spec.tsx} +3 -3
  3. package/children-highlighter/children-highlighter.tsx +9 -0
  4. package/children-highlighter/index.ts +5 -0
  5. package/{multi-highlighter/use-multi-highlighter.tsx → children-highlighter/use-children-highlighter.tsx} +15 -15
  6. package/component-highlighter.docs.md +3 -3
  7. package/dist/children-highlighter/children-highlighter.composition.d.ts +5 -0
  8. package/dist/{multi-highlighter/multi-highlighter.composition.js → children-highlighter/children-highlighter.composition.js} +29 -27
  9. package/dist/children-highlighter/children-highlighter.composition.js.map +1 -0
  10. package/dist/children-highlighter/children-highlighter.d.ts +3 -0
  11. package/dist/{multi-highlighter/multi-highlighter.js → children-highlighter/children-highlighter.js} +6 -6
  12. package/dist/children-highlighter/children-highlighter.js.map +1 -0
  13. package/dist/{multi-highlighter/multi-highlighter.spec.d.ts → children-highlighter/children-highlighter.spec.d.ts} +0 -0
  14. package/dist/{multi-highlighter/multi-highlighter.spec.js → children-highlighter/children-highlighter.spec.js} +4 -4
  15. package/dist/children-highlighter/children-highlighter.spec.js.map +1 -0
  16. package/dist/children-highlighter/index.d.ts +4 -0
  17. package/dist/children-highlighter/index.js +8 -0
  18. package/dist/children-highlighter/index.js.map +1 -0
  19. package/dist/{multi-highlighter/use-multi-highlighter.d.ts → children-highlighter/use-children-highlighter.d.ts} +2 -4
  20. package/dist/{multi-highlighter/use-multi-highlighter.js → children-highlighter/use-children-highlighter.js} +9 -12
  21. package/dist/children-highlighter/use-children-highlighter.js.map +1 -0
  22. package/dist/component-highlighter.docs.md +3 -3
  23. package/dist/element-highlighter/element-highlighter.compositions.d.ts +3 -1
  24. package/dist/element-highlighter/element-highlighter.compositions.js +15 -7
  25. package/dist/element-highlighter/element-highlighter.compositions.js.map +1 -1
  26. package/dist/element-highlighter/element-highlighter.d.ts +8 -9
  27. package/dist/element-highlighter/element-highlighter.js +3 -3
  28. package/dist/element-highlighter/element-highlighter.js.map +1 -1
  29. package/dist/element-highlighter/index.d.ts +1 -1
  30. package/dist/hover-highlighter/hover-highlighter.compositions.d.ts +0 -1
  31. package/dist/hover-highlighter/hover-highlighter.d.ts +1 -2
  32. package/dist/hover-highlighter/hover-highlighter.js +2 -2
  33. package/dist/hover-highlighter/hover-highlighter.js.map +1 -1
  34. package/dist/hover-highlighter/use-hover-highlighter.d.ts +3 -3
  35. package/dist/hover-highlighter/use-hover-highlighter.js +9 -14
  36. package/dist/hover-highlighter/use-hover-highlighter.js.map +1 -1
  37. package/dist/{hybrid-highligher → hybrid-highlighter}/hybrid-highlighter.d.ts +4 -2
  38. package/dist/{hybrid-highligher → hybrid-highlighter}/hybrid-highlighter.js +6 -6
  39. package/dist/hybrid-highlighter/hybrid-highlighter.js.map +1 -0
  40. package/dist/{hybrid-highligher → hybrid-highlighter}/index.d.ts +0 -0
  41. package/dist/{hybrid-highligher → hybrid-highlighter}/index.js +0 -0
  42. package/dist/hybrid-highlighter/index.js.map +1 -0
  43. package/dist/index.d.ts +4 -4
  44. package/dist/index.js +5 -5
  45. package/dist/index.js.map +1 -1
  46. package/dist/label/component-strip.d.ts +9 -0
  47. package/dist/label/component-strip.js +49 -0
  48. package/dist/label/component-strip.js.map +1 -0
  49. package/dist/label/component-strip.module.scss +64 -0
  50. package/dist/label/index.d.ts +4 -2
  51. package/dist/label/index.js +3 -2
  52. package/dist/label/index.js.map +1 -1
  53. package/dist/label/label-container.d.ts +13 -0
  54. package/dist/label/label-container.js +53 -0
  55. package/dist/label/label-container.js.map +1 -0
  56. package/dist/label/label.d.ts +7 -19
  57. package/dist/label/label.js +20 -27
  58. package/dist/label/label.js.map +1 -1
  59. package/dist/label/label.module.scss +24 -0
  60. package/dist/label/links.d.ts +2 -0
  61. package/dist/label/links.js +17 -0
  62. package/dist/label/links.js.map +1 -0
  63. package/dist/label/other-components.d.ts +10 -0
  64. package/dist/label/other-components.js +35 -0
  65. package/dist/label/other-components.js.map +1 -0
  66. package/dist/rule-matcher.d.ts +3 -3
  67. package/dist/rule-matcher.js +1 -0
  68. package/dist/rule-matcher.js.map +1 -1
  69. package/dist/use-animation-frame.d.ts +1 -1
  70. package/dist/use-animation-frame.js.map +1 -1
  71. package/element-highlighter/element-highlighter.compositions.tsx +22 -8
  72. package/element-highlighter/element-highlighter.tsx +11 -16
  73. package/element-highlighter/index.ts +7 -1
  74. package/hover-highlighter/hover-highlighter.tsx +1 -1
  75. package/hover-highlighter/use-hover-highlighter.tsx +18 -18
  76. package/{hybrid-highligher → hybrid-highlighter}/hybrid-highlighter.tsx +15 -5
  77. package/{hybrid-highligher → hybrid-highlighter}/index.ts +0 -0
  78. package/index.ts +4 -4
  79. package/label/component-strip.module.scss +64 -0
  80. package/label/component-strip.tsx +49 -0
  81. package/label/index.ts +5 -2
  82. package/label/label-container.tsx +46 -0
  83. package/label/label.module.scss +24 -0
  84. package/label/label.tsx +35 -66
  85. package/label/links.tsx +9 -0
  86. package/label/other-components.tsx +53 -0
  87. package/package-tar/teambit-react.ui.component-highlighter-0.0.494.tgz +0 -0
  88. package/package.json +15 -15
  89. package/rule-matcher.tsx +3 -2
  90. package/use-animation-frame.tsx +1 -1
  91. package/bubble/bubble.module.scss +0 -24
  92. package/bubble/index.ts +0 -3
  93. package/dist/bubble/bubble.module.scss +0 -24
  94. package/dist/bubble/index.d.ts +0 -1
  95. package/dist/bubble/index.js +0 -9
  96. package/dist/bubble/index.js.map +0 -1
  97. package/dist/hybrid-highligher/hybrid-highlighter.js.map +0 -1
  98. package/dist/hybrid-highligher/index.js.map +0 -1
  99. package/dist/label/component-label/component-bubble.d.ts +0 -8
  100. package/dist/label/component-label/component-bubble.js +0 -35
  101. package/dist/label/component-label/component-bubble.js.map +0 -1
  102. package/dist/label/component-label/component-label.d.ts +0 -10
  103. package/dist/label/component-label/component-label.js +0 -32
  104. package/dist/label/component-label/component-label.js.map +0 -1
  105. package/dist/label/component-label/duo-component-bubble.module.scss +0 -24
  106. package/dist/label/component-label/index.d.ts +0 -2
  107. package/dist/label/component-label/index.js +0 -6
  108. package/dist/label/component-label/index.js.map +0 -1
  109. package/dist/label/component-label/scope-bubble.d.ts +0 -7
  110. package/dist/label/component-label/scope-bubble.js +0 -28
  111. package/dist/label/component-label/scope-bubble.js.map +0 -1
  112. package/dist/label/default-label/default-label.d.ts +0 -6
  113. package/dist/label/default-label/default-label.js +0 -30
  114. package/dist/label/default-label/default-label.js.map +0 -1
  115. package/dist/label/default-label/default-label.module.scss +0 -12
  116. package/dist/label/default-label/index.d.ts +0 -1
  117. package/dist/label/default-label/index.js +0 -6
  118. package/dist/label/default-label/index.js.map +0 -1
  119. package/dist/multi-highlighter/index.d.ts +0 -2
  120. package/dist/multi-highlighter/index.js +0 -6
  121. package/dist/multi-highlighter/index.js.map +0 -1
  122. package/dist/multi-highlighter/multi-highlighter.composition.d.ts +0 -6
  123. package/dist/multi-highlighter/multi-highlighter.composition.js.map +0 -1
  124. package/dist/multi-highlighter/multi-highlighter.d.ts +0 -4
  125. package/dist/multi-highlighter/multi-highlighter.js.map +0 -1
  126. package/dist/multi-highlighter/multi-highlighter.spec.js.map +0 -1
  127. package/dist/multi-highlighter/use-multi-highlighter.js.map +0 -1
  128. package/label/component-label/component-bubble.tsx +0 -30
  129. package/label/component-label/component-label.tsx +0 -31
  130. package/label/component-label/duo-component-bubble.module.scss +0 -24
  131. package/label/component-label/index.ts +0 -2
  132. package/label/component-label/scope-bubble.tsx +0 -20
  133. package/label/default-label/default-label.module.scss +0 -12
  134. package/label/default-label/default-label.tsx +0 -22
  135. package/label/default-label/index.ts +0 -1
  136. package/multi-highlighter/index.ts +0 -2
  137. package/multi-highlighter/multi-highlighter.tsx +0 -9
  138. package/package-tar/teambit-react.ui.component-highlighter-0.0.490.tgz +0 -0
package/label/label.tsx CHANGED
@@ -1,70 +1,39 @@
1
- import React, { useMemo, useState } from 'react';
2
- import { usePopper } from 'react-popper';
3
- import { ComponentID } from '@teambit/component-id';
4
- import type { CardProps } from '@teambit/base-ui.surfaces.card';
5
- import type { Placement, Modifier } from '@popperjs/core';
6
- import '@popperjs/core';
7
-
8
- import { DefaultLabel } from './default-label';
9
- import { ComponentLabel } from './component-label';
10
- import { useAnimationFrame } from '../use-animation-frame';
11
-
12
- export interface LabelContainerProps extends React.HTMLAttributes<HTMLDivElement> {
13
- targetRef: HTMLElement | null;
14
- offset?: [number, number];
15
- placement?: Placement;
16
- flip?: boolean;
17
- /** continually update label position to match moving elements */
18
- watchMotion?: boolean;
1
+ import React, { useEffect, useState } from 'react';
2
+ import classNames from 'classnames';
3
+ import { ComponentMetaHolder } from '@teambit/react.ui.highlighter.component-metadata.bit-component-meta';
4
+
5
+ import styles from './label.module.scss';
6
+ import { ComponentStrip, ComponentStripSize } from './component-strip';
7
+ import { OtherComponentsPopper } from './other-components';
8
+
9
+ export type LabelSize = ComponentStripSize;
10
+ export interface LabelProps extends React.HTMLAttributes<HTMLDivElement> {
11
+ components: ComponentMetaHolder[];
12
+ size?: LabelSize;
19
13
  }
20
14
 
21
- export type { Placement };
22
-
23
- // TODO - replace this with TippyJS, when it supports a `targetElement={targetRef.current}` prop
24
- export function LabelContainer({
25
- targetRef,
26
- offset,
27
- placement,
28
- flip = true,
29
- watchMotion,
30
- className,
31
- ...rest
32
- }: LabelContainerProps) {
33
- const [sourceRef, setSourceRef] = useState<HTMLDivElement | null>(null);
34
-
35
- const modifiers = useMemo<Partial<Modifier<any, any>>[]>(
36
- () => [{ name: 'offset', options: { offset } }],
37
- [flip, offset]
15
+ export function Label({ components, size, ...props }: LabelProps) {
16
+ const [showMore, setShowMore] = useState(false);
17
+ const last = components.slice(-1).pop();
18
+ if (!last) return null;
19
+
20
+ const hasMore = components.length > 1;
21
+
22
+ // reset when switching targets
23
+ useEffect(() => {
24
+ setShowMore(false);
25
+ }, [components]);
26
+
27
+ return (
28
+ <OtherComponentsPopper components={components} visible={showMore} placement="bottom-start" size={size}>
29
+ <ComponentStrip {...props} component={last} size={size}>
30
+ {hasMore && (
31
+ <span
32
+ className={classNames(styles.othersTooltip, showMore && styles.active)}
33
+ onClick={() => setShowMore((x) => !x)}
34
+ />
35
+ )}
36
+ </ComponentStrip>
37
+ </OtherComponentsPopper>
38
38
  );
39
-
40
- const { styles, attributes, update } = usePopper(targetRef, sourceRef, {
41
- modifiers,
42
- placement,
43
- });
44
-
45
- useAnimationFrame(!!watchMotion && update);
46
-
47
- if (!targetRef) return null;
48
-
49
- return <div {...rest} ref={setSourceRef} className={className} style={styles.popper} {...attributes.popper} />;
50
- }
51
-
52
- export interface LabelProps extends CardProps {
53
- componentId: string;
54
- link?: string;
55
- scopeLink?: string;
56
- local?: boolean;
57
- }
58
-
59
- export function Label({ componentId, link, scopeLink, local, ...rest }: LabelProps) {
60
- const parsedId = useMemo(() => ComponentID.tryFromString(componentId), [componentId]);
61
-
62
- if (!parsedId)
63
- return (
64
- <DefaultLabel {...rest} href={link}>
65
- {componentId}
66
- </DefaultLabel>
67
- );
68
-
69
- return <ComponentLabel {...rest} local={local} componentId={parsedId} link={link} scopeLink={scopeLink} />;
70
39
  }
@@ -0,0 +1,9 @@
1
+ import urlJoin from 'url-join';
2
+ import type { ComponentID } from '@teambit/component-id';
3
+ import { ComponentUrl } from '@teambit/component.modules.component-url';
4
+
5
+ export function calcComponentLink(id: ComponentID | undefined, exported: boolean | undefined) {
6
+ if (!id) return undefined;
7
+ if (exported) return ComponentUrl.toUrl(id);
8
+ return urlJoin('/', id.fullName);
9
+ }
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import Tippy, { TippyProps } from '@tippyjs/react/headless';
3
+ import { ComponentMetaHolder } from '@teambit/react.ui.highlighter.component-metadata.bit-component-meta';
4
+
5
+ import { ComponentStrip, ComponentStripSize } from './component-strip';
6
+ import styles from './label.module.scss';
7
+
8
+ export type OtherComponentsProps = {
9
+ components: ComponentMetaHolder[];
10
+ size?: ComponentStripSize;
11
+ start?: number;
12
+ end?: number;
13
+ } & TippyProps;
14
+
15
+ // a popper ("tooltip") that shows the additional React Components related to this dom element
16
+ export function OtherComponentsPopper({
17
+ components,
18
+ children,
19
+ start,
20
+ end = -1,
21
+ size,
22
+ placement = 'bottom',
23
+ interactive = true,
24
+ ...tippyProps
25
+ }: OtherComponentsProps) {
26
+ const content = (
27
+ <>
28
+ {components
29
+ .slice(start, end)
30
+ .reverse()
31
+ .map((comp, idx) => (
32
+ <ComponentStrip key={idx} component={comp} size={size} />
33
+ ))}
34
+ </>
35
+ );
36
+
37
+ return (
38
+ <Tippy
39
+ placement={placement}
40
+ interactive={interactive}
41
+ {...tippyProps}
42
+ // second parameter "content" is always undefined, use content inline
43
+ // https://github.com/atomiks/tippyjs-react/issues/341
44
+ render={(attrs) => (
45
+ <div {...attrs} className={styles.othersContainer}>
46
+ {content}
47
+ </div>
48
+ )}
49
+ >
50
+ {children}
51
+ </Tippy>
52
+ );
53
+ }
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
1
  {
2
2
  "name": "@teambit/react.ui.component-highlighter",
3
- "version": "0.0.490",
3
+ "version": "0.0.494",
4
4
  "homepage": "https://bit.dev/teambit/react/ui/component-highlighter",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.react",
8
8
  "name": "ui/component-highlighter",
9
- "version": "0.0.490"
9
+ "version": "0.0.494"
10
10
  },
11
11
  "dependencies": {
12
+ "get-xpath": "3.0.1",
12
13
  "classnames": "2.2.6",
13
14
  "@popperjs/core": "2.6.0",
14
15
  "react-popper": "2.2.4",
15
16
  "use-debounce": "6.0.1",
16
17
  "uuid": "3.4.0",
17
- "get-xpath": "3.0.1",
18
18
  "url-join": "4.0.1",
19
+ "@tippyjs/react": "4.2.0",
19
20
  "core-js": "^3.0.0",
20
- "@teambit/component-id": "0.0.388",
21
- "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.9",
22
- "@teambit/ui-foundation.ui.constants.z-indexes": "0.0.476",
23
21
  "@teambit/base-ui.utils.popper-js.ignore-popper-size": "1.0.0",
24
22
  "@teambit/base-ui.utils.popper-js.resize-to-match-reference": "1.0.0",
25
- "@teambit/react.modules.dom-to-react": "0.0.476",
26
- "@teambit/react.ui.hover-selector": "0.0.154",
27
- "@teambit/base-ui.surfaces.card": "1.0.1",
28
23
  "@teambit/base-ui.routing.native-link": "1.0.0",
29
- "@teambit/component.modules.component-url": "0.0.109"
24
+ "@teambit/component-id": "0.0.390",
25
+ "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.12",
26
+ "@teambit/react.modules.dom-to-react": "0.0.478",
27
+ "@teambit/ui-foundation.ui.constants.z-indexes": "0.0.478",
28
+ "@teambit/react.ui.hover-selector": "0.0.156",
29
+ "@teambit/component.modules.component-url": "0.0.111"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/classnames": "2.2.11",
32
+ "@types/react": "^17.0.8",
33
33
  "@testing-library/react": "11.2.6",
34
+ "@types/classnames": "2.2.11",
35
+ "@types/react-dom": "^17.0.5",
34
36
  "@types/uuid": "3.4.9",
35
37
  "@types/url-join": "4.0.0",
36
38
  "@types/mocha": "5.2.7",
37
39
  "@types/testing-library__jest-dom": "5.9.5",
38
40
  "@babel/runtime": "7.12.18",
39
41
  "@types/jest": "^26.0.0",
40
- "@types/react-dom": "^17.0.5",
41
- "@types/react": "^17.0.8",
42
42
  "@types/node": "12.20.4",
43
43
  "@teambit/design.ui.icon-button": "1.0.10"
44
44
  },
45
45
  "peerDependencies": {
46
- "@teambit/legacy": "1.0.184",
46
+ "@teambit/legacy": "1.0.186",
47
47
  "react-dom": "^16.8.0 || ^17.0.0",
48
48
  "react": "^16.8.0 || ^17.0.0"
49
49
  },
@@ -71,7 +71,7 @@
71
71
  "react": "-"
72
72
  },
73
73
  "peerDependencies": {
74
- "@teambit/legacy": "1.0.184",
74
+ "@teambit/legacy": "1.0.186",
75
75
  "react-dom": "^16.8.0 || ^17.0.0",
76
76
  "react": "^16.8.0 || ^17.0.0"
77
77
  }
package/rule-matcher.tsx CHANGED
@@ -1,8 +1,7 @@
1
+ // in the future, we will add more options here, like include / exclude objects.
1
2
  import { ComponentID } from '@teambit/component-id';
2
3
  import { ComponentMeta } from '@teambit/react.ui.highlighter.component-metadata.bit-component-meta';
3
4
 
4
- export type ComponentMatchTarget = { meta: ComponentMeta };
5
-
6
5
  export type MatchRule = undefined | string | ((element: HTMLElement) => boolean);
7
6
  export type ComponentMatchRule = undefined | string | string[] | ((target: ComponentMatchTarget) => boolean);
8
7
 
@@ -18,6 +17,8 @@ export function ruleMatcher(element: HTMLElement, rule: MatchRule) {
18
17
  return true;
19
18
  }
20
19
 
20
+ export type ComponentMatchTarget = { meta: ComponentMeta };
21
+
21
22
  export function componentRuleMatcher(target: ComponentMatchTarget, rule: ComponentMatchRule): boolean {
22
23
  if (typeof rule === 'string') {
23
24
  const targetCmpId = ComponentID.tryFromString(target.meta.id);
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
2
2
 
3
3
  // TODO - extract to its own component
4
4
 
5
- export function useAnimationFrame(cb?: false | null | (() => any), deps: [] = []) {
5
+ export function useAnimationFrame(cb?: false | null | (() => any), deps: any[] = []) {
6
6
  useEffect(() => {
7
7
  if (!cb) return () => {};
8
8
 
@@ -1,24 +0,0 @@
1
- .bubble {
2
- padding: 0.23em 1em;
3
-
4
- transition: filter 300ms, background-color 300ms;
5
- transform: translateZ(0); //fix blurriness in Safari
6
-
7
- // override styles from <a>
8
- &:link,
9
- &:visited {
10
- text-decoration: inherit;
11
- color: inherit;
12
-
13
- background: var(--bit-highlighter-color, #eebcc9);
14
-
15
- &:hover {
16
- background: var(--bit-highlighter-color-hover, #f6dae2);
17
- }
18
-
19
- &:active {
20
- background: var(--bit-highlighter-color-active, #e79db1);
21
- color: inherit;
22
- }
23
- }
24
- }
package/bubble/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import styles from './bubble.module.scss';
2
-
3
- export const bubble = styles.bubble;
@@ -1,24 +0,0 @@
1
- .bubble {
2
- padding: 0.23em 1em;
3
-
4
- transition: filter 300ms, background-color 300ms;
5
- transform: translateZ(0); //fix blurriness in Safari
6
-
7
- // override styles from <a>
8
- &:link,
9
- &:visited {
10
- text-decoration: inherit;
11
- color: inherit;
12
-
13
- background: var(--bit-highlighter-color, #eebcc9);
14
-
15
- &:hover {
16
- background: var(--bit-highlighter-color-hover, #f6dae2);
17
- }
18
-
19
- &:active {
20
- background: var(--bit-highlighter-color-active, #e79db1);
21
- color: inherit;
22
- }
23
- }
24
- }
@@ -1 +0,0 @@
1
- export declare const bubble: string;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.bubble = void 0;
7
- const bubble_module_scss_1 = __importDefault(require("./bubble.module.scss"));
8
- exports.bubble = bubble_module_scss_1.default.bubble;
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../bubble/index.ts"],"names":[],"mappings":";;;;;;AAAA,8EAA0C;AAE7B,QAAA,MAAM,GAAG,4BAAM,CAAC,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hybrid-highlighter.js","sourceRoot":"","sources":["../../hybrid-highligher/hybrid-highlighter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,4DAAoC;AACpC,+BAA0B;AAE1B,4DAA2D;AAC3D,gEAA0G;AAC1G,sFAAiF;AAoCjF,kDAAkD;AAClD,SAAgB,iBAAiB,CAAC,EAkBT;QAlBS,EAChC,QAAQ,EACR,IAAI,GAAG,OAAO,EACd,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,IAAI,EAClB,SAAS,EACT,IAAI,EACJ,aAAa,EAEb,OAAO,EACP,cAAc,EACd,SAAS,EACT,KAAK,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,QAAQ,OAEe,EADpB,IAAI,cAjByB,yMAkBjC,CADQ;IAEP,MAAM,GAAG,GAAG,IAAA,iBAAS,GAAkB,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAkC,EAAE,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,YAAY,IAAA,SAAE,GAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IACtD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAEtD,8BAA8B;IAC9B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,QAAQ;YAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,QAAQ,GAAG,IAAA,uCAAmB,EAClC,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC3E,IAAI,EACJ;QACE,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACpD,UAAU;QACV,QAAQ,EAAE,QAAQ,IAAI,IAAI,KAAK,OAAO;QACtC,IAAI;QACJ,aAAa;KACd,CACF,CAAC;IAEF,IAAA,2CAAmB,EAAC;QAClB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,GAAG;QACb,UAAU;QACV,QAAQ,EAAE,QAAQ,IAAI,IAAI,KAAK,aAAa;QAC5C,IAAI;QACJ,aAAa;KACd,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE,CAAC,iBACJ,yBAAyB,EAAE,OAAO,EAClC,+BAA+B,EAAE,YAAY,EAC7C,gCAAgC,EAAE,aAAa,IAC5C,KAAK,EACR,EACF,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,CAAC,CAC9C,CAAC;IAEF,OAAO,CACL,qDACE,GAAG,EAAE,GAAG,IACJ,IAAI,EACJ,QAAQ,IACZ,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,UAAU,CAAC;QAG3C,QAAQ;QAKR,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAC9C,8BAAC,wCAAkB,IACjB,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC,CACE,CACP,CAAC;AACJ,CAAC;AAtFD,8CAsFC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../hybrid-highligher/index.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA"}
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentID } from '@teambit/component-id';
3
- import { LinkProps } from '@teambit/base-ui.routing.native-link';
4
- export interface ComponentBubbleProps extends LinkProps {
5
- componentId: ComponentID;
6
- local?: boolean;
7
- }
8
- export declare function ComponentBubble({ componentId, className, href, local, ...rest }: ComponentBubbleProps): JSX.Element;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ComponentBubble = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const classnames_1 = __importDefault(require("classnames"));
20
- const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
21
- const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
22
- const url_join_1 = __importDefault(require("url-join"));
23
- const duo_component_bubble_module_scss_1 = __importDefault(require("./duo-component-bubble.module.scss"));
24
- function ComponentBubble(_a) {
25
- var { componentId, className, href, local = false } = _a, rest = __rest(_a, ["componentId", "className", "href", "local"]);
26
- const { version, fullName } = componentId;
27
- const componentHref = href || (local ? (0, url_join_1.default)('/', fullName) : component_modules_component_url_1.ComponentUrl.toUrl(componentId));
28
- return (react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, Object.assign({ external: true, href: componentHref, className: (0, classnames_1.default)(duo_component_bubble_module_scss_1.default.componentName, className) }, rest),
29
- react_1.default.createElement("div", { className: duo_component_bubble_module_scss_1.default.fullName }, fullName),
30
- version && version !== 'latest' && (react_1.default.createElement("div", { className: duo_component_bubble_module_scss_1.default.version },
31
- react_1.default.createElement("span", { className: duo_component_bubble_module_scss_1.default.versionPrefix }, "@"),
32
- version))));
33
- }
34
- exports.ComponentBubble = ComponentBubble;
35
- //# sourceMappingURL=component-bubble.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-bubble.js","sourceRoot":"","sources":["../../../label/component-label/component-bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AAEpC,sFAA6E;AAC7E,8FAAwE;AACxE,wDAA+B;AAC/B,0GAAwD;AAOxD,SAAgB,eAAe,CAAC,EAA8E;QAA9E,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,OAAiC,EAA5B,IAAI,cAAtD,6CAAwD,CAAF;IACpF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IAC1C,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,8CAAY,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjG,OAAO,CACL,8BAAC,wCAAU,kBAAC,QAAQ,QAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,0CAAM,CAAC,aAAa,EAAE,SAAS,CAAC,IAAM,IAAI;QACxG,uCAAK,SAAS,EAAE,0CAAM,CAAC,QAAQ,IAAG,QAAQ,CAAO;QAEhD,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,CAClC,uCAAK,SAAS,EAAE,0CAAM,CAAC,OAAO;YAC5B,wCAAM,SAAS,EAAE,0CAAM,CAAC,aAAa,QAAU;YAC9C,OAAO,CACJ,CACP,CACU,CACd,CAAC;AACJ,CAAC;AAhBD,0CAgBC"}
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardProps } from '@teambit/base-ui.surfaces.card';
3
- import type { ComponentID } from '@teambit/component-id';
4
- export interface ComponentLabelProps extends CardProps {
5
- componentId: ComponentID;
6
- link?: string;
7
- scopeLink?: string;
8
- local?: boolean;
9
- }
10
- export declare function ComponentLabel({ componentId, className, link, scopeLink, local, ...rest }: ComponentLabelProps): JSX.Element;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ComponentLabel = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const classnames_1 = __importDefault(require("classnames"));
20
- const base_ui_surfaces_card_1 = require("@teambit/base-ui.surfaces.card");
21
- const bubble_1 = require("../../bubble");
22
- const duo_component_bubble_module_scss_1 = __importDefault(require("./duo-component-bubble.module.scss"));
23
- const component_bubble_1 = require("./component-bubble");
24
- const scope_bubble_1 = require("./scope-bubble");
25
- function ComponentLabel(_a) {
26
- var { componentId, className, link, scopeLink, local } = _a, rest = __rest(_a, ["componentId", "className", "link", "scopeLink", "local"]);
27
- return (react_1.default.createElement(base_ui_surfaces_card_1.Card, Object.assign({}, rest, { className: (0, classnames_1.default)(className, duo_component_bubble_module_scss_1.default.duoComponentBubble) }),
28
- react_1.default.createElement(scope_bubble_1.ScopeBubble, { href: scopeLink, componentId: componentId, className: bubble_1.bubble }),
29
- react_1.default.createElement(component_bubble_1.ComponentBubble, { href: link, componentId: componentId, className: bubble_1.bubble, local: local })));
30
- }
31
- exports.ComponentLabel = ComponentLabel;
32
- //# sourceMappingURL=component-label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-label.js","sourceRoot":"","sources":["../../../label/component-label/component-label.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AACpC,0EAAiE;AAGjE,yCAAsC;AACtC,0GAAwD;AAExD,yDAAqD;AACrD,iDAA6C;AAS7C,SAAgB,cAAc,CAAC,EAAgF;QAAhF,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,OAAgC,EAA3B,IAAI,cAAzD,0DAA2D,CAAF;IACtF,OAAO,CACL,8BAAC,4BAAI,oBAAK,IAAI,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,0CAAM,CAAC,kBAAkB,CAAC;QACzE,8BAAC,0BAAW,IAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,eAAM,GAAI;QAC7E,8BAAC,kCAAe,IACd,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,eAAM,EACjB,KAAK,EAAE,KAAK,GACZ,CACG,CACR,CAAC;AACJ,CAAC;AAZD,wCAYC"}
@@ -1,24 +0,0 @@
1
- .duoComponentBubble {
2
- display: flex;
3
-
4
- //reset styles from card:
5
- padding: 0;
6
- border: none;
7
- background: none;
8
-
9
- > :first-child {
10
- border-top-left-radius: 4px;
11
- border-bottom-left-radius: 4px;
12
-
13
- margin-right: 2px;
14
- }
15
-
16
- > :last-child {
17
- border-top-right-radius: 4px;
18
- border-bottom-right-radius: 4px;
19
- }
20
- }
21
-
22
- .componentName {
23
- display: flex;
24
- }
@@ -1,2 +0,0 @@
1
- export { ComponentLabel } from './component-label';
2
- export type { ComponentLabelProps } from './component-label';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ComponentLabel = void 0;
4
- var component_label_1 = require("./component-label");
5
- Object.defineProperty(exports, "ComponentLabel", { enumerable: true, get: function () { return component_label_1.ComponentLabel; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../label/component-label/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentID } from '@teambit/component-id';
3
- import { LinkProps } from '@teambit/base-ui.routing.native-link';
4
- export interface ScopeBubbleProps extends LinkProps {
5
- componentId: ComponentID;
6
- }
7
- export declare function ScopeBubble({ componentId, className, href, ...rest }: ScopeBubbleProps): JSX.Element;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ScopeBubble = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
20
- const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
21
- function ScopeBubble(_a) {
22
- var { componentId, className, href } = _a, rest = __rest(_a, ["componentId", "className", "href"]);
23
- const scope = componentId.scope;
24
- const scopeUrl = href || component_modules_component_url_1.ScopeUrl.toUrl(componentId.scope);
25
- return (react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, Object.assign({ href: scopeUrl, external: true, className: className }, rest), scope));
26
- }
27
- exports.ScopeBubble = ScopeBubble;
28
- //# sourceMappingURL=scope-bubble.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope-bubble.js","sourceRoot":"","sources":["../../../label/component-label/scope-bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAG1B,sFAA6E;AAC7E,8FAAoE;AAMpE,SAAgB,WAAW,CAAC,EAA2D;QAA3D,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,OAA6B,EAAxB,IAAI,cAAvC,oCAAyC,CAAF;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAI,IAAI,0CAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE3D,OAAO,CACL,8BAAC,wCAAU,kBAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,QAAC,SAAS,EAAE,SAAS,IAAM,IAAI,GAChE,KAAK,CACK,CACd,CAAC;AACJ,CAAC;AATD,kCASC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardProps } from '@teambit/base-ui.surfaces.card';
3
- export interface DefaultLabelProps extends CardProps {
4
- href?: string;
5
- }
6
- export declare function DefaultLabel({ className, href, children, ...rest }: DefaultLabelProps): JSX.Element;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.DefaultLabel = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const classnames_1 = __importDefault(require("classnames"));
20
- const base_ui_surfaces_card_1 = require("@teambit/base-ui.surfaces.card");
21
- const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
22
- const bubble_1 = require("../../bubble");
23
- const default_label_module_scss_1 = __importDefault(require("./default-label.module.scss"));
24
- function DefaultLabel(_a) {
25
- var { className, href, children } = _a, rest = __rest(_a, ["className", "href", "children"]);
26
- return (react_1.default.createElement(base_ui_surfaces_card_1.Card, Object.assign({}, rest, { className: (0, classnames_1.default)(default_label_module_scss_1.default.container, className) }),
27
- react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, { external: true, href: href, className: bubble_1.bubble }, children)));
28
- }
29
- exports.DefaultLabel = DefaultLabel;
30
- //# sourceMappingURL=default-label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-label.js","sourceRoot":"","sources":["../../../label/default-label/default-label.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AAEpC,0EAAiE;AACjE,sFAAkE;AAElE,yCAAsC;AACtC,4FAAiD;AAMjD,SAAgB,YAAY,CAAC,EAAyD;QAAzD,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,OAA8B,EAAzB,IAAI,cAApC,iCAAsC,CAAF;IAC/D,OAAO,CACL,8BAAC,4BAAI,oBAAK,IAAI,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,mCAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QAChE,8BAAC,wCAAU,IAAC,QAAQ,QAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,eAAM,IAC/C,QAAQ,CACE,CACR,CACR,CAAC;AACJ,CAAC;AARD,oCAQC"}
@@ -1,12 +0,0 @@
1
- .container {
2
- display: flex;
3
-
4
- //reset styles from card:
5
- padding: 0;
6
- border: none;
7
- background: none;
8
-
9
- > * {
10
- border-radius: 4px;
11
- }
12
- }
@@ -1 +0,0 @@
1
- export { DefaultLabel } from './default-label';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultLabel = void 0;
4
- var default_label_1 = require("./default-label");
5
- Object.defineProperty(exports, "DefaultLabel", { enumerable: true, get: function () { return default_label_1.DefaultLabel; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../label/default-label/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA"}
@@ -1,2 +0,0 @@
1
- export { MultiHighlighter } from './multi-highlighter';
2
- export type { MultiHighlighterProps } from './multi-highlighter';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiHighlighter = void 0;
4
- var multi_highlighter_1 = require("./multi-highlighter");
5
- Object.defineProperty(exports, "MultiHighlighter", { enumerable: true, get: function () { return multi_highlighter_1.MultiHighlighter; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../multi-highlighter/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}