@olenbetong/synergi-react 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/ob.react.js +43 -56
- package/dist/esm/ob.react.min.css.map +1 -1
- package/dist/esm/ob.react.min.js +1 -1
- package/dist/esm/ob.react.min.js.map +3 -3
- package/dist/iife/ob.react.js +46 -59
- package/dist/iife/ob.react.min.css.map +1 -1
- package/dist/iife/ob.react.min.js +1 -1
- package/dist/iife/ob.react.min.js.map +3 -3
- package/dist/styles/styles.css +1 -1
- package/dist/styles/styles.css.map +1 -1
- package/es/Checkbox/index.js +1 -0
- package/es/ColorCard/index.css +1 -1
- package/es/DateNavigator/index.css +1 -1
- package/es/DateNavigator/index.js +1 -1
- package/es/LinkedCardList/index.css +1 -1
- package/es/PageBanner/index.css +1 -1
- package/es/PageBanner/index.js +2 -1
- package/es/Portal/index.js +5 -7
- package/es/Sidebar/index.js +1 -0
- package/es/Spinner/index.d.ts +1 -1
- package/es/SplitContainer/index.d.ts +1 -1
- package/es/SplitContainer/index.js +2 -1
- package/es/ValueToggle/index.js +1 -1
- package/es/index.css +1 -1
- package/es/useTranslation/index.js +2 -1
- package/package.json +5 -5
- package/src/Checkbox/index.tsx +2 -1
- package/src/ColorCard/index.scss +3 -3
- package/src/DateNavigator/index.scss +2 -2
- package/src/DateNavigator/index.tsx +1 -1
- package/src/LinkedCardList/index.scss +4 -4
- package/src/PageBanner/index.scss +8 -8
- package/src/PageBanner/index.tsx +2 -1
- package/src/Portal/index.tsx +8 -7
- package/src/ProgressBar/index.scss +3 -3
- package/src/Sidebar/index.tsx +1 -0
- package/src/Spinner/index.tsx +1 -1
- package/src/SplitContainer/index.tsx +6 -4
- package/src/ValueToggle/index.scss +1 -1
- package/src/ValueToggle/index.tsx +1 -1
- package/src/index.scss +9 -9
- package/src/useTranslation/index.ts +2 -1
|
@@ -2,7 +2,8 @@ import "./index.scss";
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import localforage from "localforage";
|
|
5
|
-
import React
|
|
5
|
+
import type React from "react";
|
|
6
|
+
import { Children, forwardRef, useEffect, useRef, useState } from "react";
|
|
6
7
|
|
|
7
8
|
const article = globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split("/")[0];
|
|
8
9
|
const settingsStore = localforage.createInstance({
|
|
@@ -63,7 +64,7 @@ type DividerProps = {
|
|
|
63
64
|
|
|
64
65
|
const Divider = forwardRef<HTMLDivElement, DividerProps>(function Divider(props: DividerProps, ref) {
|
|
65
66
|
return (
|
|
66
|
-
<div
|
|
67
|
+
<div className={clsx("ObSplitContainer-divider", props.className)} ref={ref}>
|
|
67
68
|
<span>•••</span>
|
|
68
69
|
</div>
|
|
69
70
|
);
|
|
@@ -174,6 +175,7 @@ export function SplitContainer({
|
|
|
174
175
|
|
|
175
176
|
let childrenArray = Children.toArray(children);
|
|
176
177
|
|
|
178
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
177
179
|
useEffect(() => {
|
|
178
180
|
let divider = dividerRef.current;
|
|
179
181
|
if (divider) {
|
|
@@ -229,8 +231,8 @@ export function SplitContainer({
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
function handleKeyDown(event: KeyboardEvent) {
|
|
232
|
-
let reduce
|
|
233
|
-
let shouldHandle
|
|
234
|
+
let reduce = true;
|
|
235
|
+
let shouldHandle = false;
|
|
234
236
|
if (!event.altKey && !event.ctrlKey && !event.metaKey) {
|
|
235
237
|
if (direction === "horizontal" && ["ArrowLeft", "ArrowRight"].includes(event.key)) {
|
|
236
238
|
shouldHandle = true;
|
|
@@ -23,7 +23,7 @@ function ValueToggleInner(
|
|
|
23
23
|
}>,
|
|
24
24
|
) {
|
|
25
25
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
26
|
-
const [toggleName] = useState(
|
|
26
|
+
const [toggleName] = useState(`obet-value-toggle-${String(++valueToggleId)}`);
|
|
27
27
|
const isControlled = value !== undefined;
|
|
28
28
|
|
|
29
29
|
useImperativeHandle(ref, () => {
|
package/src/index.scss
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
8
|
-
@
|
|
9
|
-
@
|
|
1
|
+
@use "Checkbox/index.scss";
|
|
2
|
+
@use "ColorCard/index.scss" as index2;
|
|
3
|
+
@use "DateNavigator/index.scss" as index3;
|
|
4
|
+
@use "LinkedCardList/index.scss" as index4;
|
|
5
|
+
@use "PageBanner/index.scss" as index5;
|
|
6
|
+
@use "ProgressBar/index.scss" as index6;
|
|
7
|
+
@use "Sidebar/index.scss" as index7;
|
|
8
|
+
@use "SplitContainer/index.scss" as index8;
|
|
9
|
+
@use "ValueToggle/index.scss" as index9;
|
|
@@ -16,7 +16,7 @@ async function translateText(text: string, target: string, apiKey: string) {
|
|
|
16
16
|
let json = await result.json();
|
|
17
17
|
let { data } = json;
|
|
18
18
|
|
|
19
|
-
if (data
|
|
19
|
+
if (data?.translations) {
|
|
20
20
|
let [translation] = data.translations;
|
|
21
21
|
|
|
22
22
|
return {
|
|
@@ -35,6 +35,7 @@ export function useTranslation(text: string, targetLanguage: string, apiKey: str
|
|
|
35
35
|
let [isTranslating, setIsTranslating] = useState(false);
|
|
36
36
|
let textRef = useRef(text);
|
|
37
37
|
|
|
38
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: this is a way of resetting the state so we don't show outdated translations when the text changes
|
|
38
39
|
useEffect(() => {
|
|
39
40
|
textRef.current = text;
|
|
40
41
|
return () => {
|