@appquality/unguess-design-system 3.1.113 → 3.1.115

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/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # v3.1.115 (Thu Oct 10 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Add start - end attrs to observation [#423](https://github.com/AppQuality/unguess-design-system/pull/423) ([@d-beezee](https://github.com/d-beezee))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@d-beezee](https://github.com/d-beezee)
10
+
11
+ ---
12
+
13
+ # v3.1.114 (Mon Oct 07 2024)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - fix: Use isExpanded style for panel container [#421](https://github.com/AppQuality/unguess-design-system/pull/421) ([@d-beezee](https://github.com/d-beezee))
18
+ - fix: Use isExpanded style for panel container [#420](https://github.com/AppQuality/unguess-design-system/pull/420) ([@d-beezee](https://github.com/d-beezee))
19
+
20
+ #### Authors: 1
21
+
22
+ - [@d-beezee](https://github.com/d-beezee)
23
+
24
+ ---
25
+
1
26
  # v3.1.113 (Thu Oct 03 2024)
2
27
 
3
28
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -251,7 +251,6 @@ styled.css `
251
251
  const sidebarNavItemExpanded = styled.css `
252
252
  visibility: visible;
253
253
  opacity: 1;
254
- // transition: opacity 0.2s ease;
255
254
  `;
256
255
  const sidebarNavItemHidden = styled.css `
257
256
  visibility: hidden;
@@ -783,6 +782,11 @@ Used for this
783
782
  **/
784
783
  const IconButton = React.forwardRef((props, ref) => jsxRuntime.jsx(reactButtons.IconButton, Object.assign({ ref: ref }, props)));
785
784
 
785
+ const SplitButtonWrapper = styled__default["default"].div `
786
+ [data-garden-id="buttons.button"] {
787
+ margin-right: -1px;
788
+ }
789
+ `;
786
790
  /**
787
791
  A Split button is a hybrid between a Dropdown Menu and a Button. It lets users choose from parallel actions and take action on their choice.
788
792
  <hr>
@@ -790,7 +794,7 @@ Used for this:
790
794
  - To let users select from multiple parallel actions. Actions are parallel when each represents a path forward for the user and none cancel the action.
791
795
  - To reduce visual complexity when there are multiple actions a user can take
792
796
  **/
793
- const SplitButton = React.forwardRef((props, ref) => jsxRuntime.jsx(reactButtons.SplitButton, Object.assign({ ref: ref }, props)));
797
+ const SplitButton = React.forwardRef((props, ref) => (jsxRuntime.jsx(SplitButtonWrapper, { children: jsxRuntime.jsx(reactButtons.SplitButton, Object.assign({ ref: ref }, props)) })));
794
798
 
795
799
  /**
796
800
  * Use Span to style and format inline text elements.
@@ -6394,6 +6398,10 @@ const NavAccordionItem = styled__default["default"](Accordion) `
6394
6398
  order: 1;
6395
6399
  margin: ${({ theme }) => theme.space.xs} 0;
6396
6400
  padding-left: 8.5px;
6401
+ .panelContainer {
6402
+ ${sidebarNavItemExpanded}
6403
+ ${(props) => !props.isExpanded && sidebarNavItemHidden}
6404
+ }
6397
6405
  `;
6398
6406
  const AccordionItemHeader = styled__default["default"](Accordion.Header) `
6399
6407
  > svg {
@@ -7360,7 +7368,9 @@ const DefaultWordWrapper = ({ children }) => {
7360
7368
  };
7361
7369
  const DefaultObservationWrapper = ({ title, color, children, observations, }) => {
7362
7370
  const background = color + "50";
7363
- return (jsxRuntime.jsx("span", Object.assign({ "data-title": title, style: { background } }, { children: jsxRuntime.jsx(Tooltip, Object.assign({ content: observations.map((o) => o.title).join(" and ") }, { children: jsxRuntime.jsx("span", { children: children }) })) })));
7371
+ return (jsxRuntime.jsx("span", Object.assign({ "data-title": title, style: { background } }, { children: jsxRuntime.jsx(Tooltip, Object.assign({ content: observations.map((o) => (jsxRuntime.jsx("div", Object.assign({ onClick: () => {
7372
+ alert(`Clicked on observation ${o.id} - start: ${o.start}`);
7373
+ } }, { children: o.title })))) }, { children: jsxRuntime.jsx("span", { children: children }) })) })));
7364
7374
  };
7365
7375
  const DefaultParagraphWrapper = ({ children }) => {
7366
7376
  return jsxRuntime.jsx("p", Object.assign({ style: { marginBottom: "20px" } }, { children: children }));
@@ -7522,6 +7532,8 @@ class ContentParser {
7522
7532
  {
7523
7533
  type: "Observation",
7524
7534
  attrs: {
7535
+ start: observation.start,
7536
+ end: observation.end,
7525
7537
  id: observation.id,
7526
7538
  title: observation.text,
7527
7539
  color: observation.color,
@@ -7695,6 +7707,7 @@ const Component$2 = ({ node, editor, }) => {
7695
7707
  const ancestors = findAllAncestorsOfType(editor.state, nodePos, editor.state.schema.nodes.Observation);
7696
7708
  const observationsNodes = ancestors.length ? [node, ...ancestors] : [node];
7697
7709
  return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "div", style: { display: "inline" } }, { children: jsxRuntime.jsx(ObservationWrapper, Object.assign({ title: node.attrs["title"], color: node.attrs["color"], observations: observationsNodes.map((o) => ({
7710
+ start: o.attrs["start"],
7698
7711
  id: o.attrs["id"],
7699
7712
  title: o.attrs["title"],
7700
7713
  color: o.attrs["color"],
@@ -7707,6 +7720,12 @@ const Observation = core.Node.create({
7707
7720
  inline: true,
7708
7721
  addAttributes() {
7709
7722
  return {
7723
+ start: {
7724
+ default: 0,
7725
+ },
7726
+ end: {
7727
+ default: 0,
7728
+ },
7710
7729
  id: {
7711
7730
  default: 0,
7712
7731
  },
@@ -7729,9 +7748,20 @@ const Observation = core.Node.create({
7729
7748
  return {
7730
7749
  addObservation: ({ id, title, color }) => ({ tr, state, view }) => {
7731
7750
  const { from, to } = state.selection;
7751
+ let firstWord, lastWord;
7752
+ state.doc.nodesBetween(from, to, (node, pos) => {
7753
+ if (node.type.name === "Word") {
7754
+ if (!firstWord) {
7755
+ firstWord = node;
7756
+ }
7757
+ lastWord = node;
7758
+ }
7759
+ });
7732
7760
  state.doc.nodesBetween(from, to, (node, pos) => {
7733
7761
  if (node.type.name === "Word") {
7734
7762
  const annotationNode = state.schema.nodes.Observation.create({
7763
+ start: firstWord.attrs["data-start"],
7764
+ end: lastWord.attrs["data-end"],
7735
7765
  id,
7736
7766
  title,
7737
7767
  color,
@@ -12,6 +12,7 @@ declare const DefaultObservationWrapper: ({ title, color, children, observations
12
12
  color: string;
13
13
  children: ReactNode;
14
14
  observations: {
15
+ start: number;
15
16
  id: number;
16
17
  title: string;
17
18
  color: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.113",
3
+ "version": "3.1.115",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",