@kodiak-finance/orderly-ui-tradingview 2.9.2 → 2.9.3

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/index.d.mts CHANGED
@@ -15727,6 +15727,7 @@ interface ColorConfigInterface {
15727
15727
  }
15728
15728
 
15729
15729
  type TradingviewLocaleCode = LanguageCode;
15730
+ type TradingviewDirection = "ltr" | "rtl";
15730
15731
  interface TradingviewWidgetPropsInterface {
15731
15732
  symbol?: string;
15732
15733
  mode?: ChartMode;
@@ -15787,6 +15788,7 @@ interface TradingviewUIPropsInterface {
15787
15788
  root?: string;
15788
15789
  content?: string;
15789
15790
  };
15791
+ direction?: TradingviewDirection;
15790
15792
  fullscreen?: boolean;
15791
15793
  }
15792
15794
  interface DisplayControlSettingInterface {
@@ -15857,6 +15859,7 @@ declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
15857
15859
  root?: string;
15858
15860
  content?: string;
15859
15861
  } | undefined;
15862
+ direction: "ltr" | "rtl";
15860
15863
  fullscreen: any;
15861
15864
  };
15862
15865
 
@@ -15868,4 +15871,4 @@ declare const DesktopDisplayControl: React.FC<IProps>;
15868
15871
 
15869
15872
  declare const MobileDisplayControl: React.FC<IProps>;
15870
15873
 
15871
- export { DesktopDisplayControl, type DesktopDisplayControlMenuItem, type DesktopDisplayControlMenuListProps, DesktopDisplayControlMenuListTarget, type DisplayControlSettingInterface, InjectableTradingviewDesktop, MobileDisplayControl, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
15874
+ export { DesktopDisplayControl, type DesktopDisplayControlMenuItem, type DesktopDisplayControlMenuListProps, DesktopDisplayControlMenuListTarget, type DisplayControlSettingInterface, InjectableTradingviewDesktop, MobileDisplayControl, type TradingviewDirection, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
package/dist/index.d.ts CHANGED
@@ -15727,6 +15727,7 @@ interface ColorConfigInterface {
15727
15727
  }
15728
15728
 
15729
15729
  type TradingviewLocaleCode = LanguageCode;
15730
+ type TradingviewDirection = "ltr" | "rtl";
15730
15731
  interface TradingviewWidgetPropsInterface {
15731
15732
  symbol?: string;
15732
15733
  mode?: ChartMode;
@@ -15787,6 +15788,7 @@ interface TradingviewUIPropsInterface {
15787
15788
  root?: string;
15788
15789
  content?: string;
15789
15790
  };
15791
+ direction?: TradingviewDirection;
15790
15792
  fullscreen?: boolean;
15791
15793
  }
15792
15794
  interface DisplayControlSettingInterface {
@@ -15857,6 +15859,7 @@ declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
15857
15859
  root?: string;
15858
15860
  content?: string;
15859
15861
  } | undefined;
15862
+ direction: "ltr" | "rtl";
15860
15863
  fullscreen: any;
15861
15864
  };
15862
15865
 
@@ -15868,4 +15871,4 @@ declare const DesktopDisplayControl: React.FC<IProps>;
15868
15871
 
15869
15872
  declare const MobileDisplayControl: React.FC<IProps>;
15870
15873
 
15871
- export { DesktopDisplayControl, type DesktopDisplayControlMenuItem, type DesktopDisplayControlMenuListProps, DesktopDisplayControlMenuListTarget, type DisplayControlSettingInterface, InjectableTradingviewDesktop, MobileDisplayControl, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
15874
+ export { DesktopDisplayControl, type DesktopDisplayControlMenuItem, type DesktopDisplayControlMenuListProps, DesktopDisplayControlMenuListTarget, type DisplayControlSettingInterface, InjectableTradingviewDesktop, MobileDisplayControl, type TradingviewDirection, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
package/dist/index.js CHANGED
@@ -489,7 +489,7 @@ var init_timeInterval = __esm({
489
489
  "div",
490
490
  {
491
491
  className: orderlyUi.cn(
492
- "oui-text-2xs oui-text-base-contrast-36 oui-flex oui-gap-[2px] oui-items-center oui-mr-3 oui-font-semibold",
492
+ "oui-text-2xs oui-text-base-contrast-36 oui-flex oui-gap-[2px] oui-items-center oui-me-3 oui-font-semibold",
493
493
  "oui-overflow-hidden"
494
494
  ),
495
495
  children: timeIntervalMap.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -562,7 +562,7 @@ var init_timeInterval = __esm({
562
562
  "oui-overflow-hidden"
563
563
  ),
564
564
  children: [
565
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: " oui-flex oui-gap-1 oui-items-center oui-mr-3 oui-font-semibold", children: mobileTimeIntervalDefaultMap.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
565
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: " oui-flex oui-gap-1 oui-items-center oui-me-3 oui-font-semibold", children: mobileTimeIntervalDefaultMap.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
566
566
  "div",
567
567
  {
568
568
  className: orderlyUi.cn(
@@ -4349,6 +4349,7 @@ var Widget = class {
4349
4349
  datafeed: options.datafeed,
4350
4350
  studies_overrides: options.studiesOverrides,
4351
4351
  locale: options.locale,
4352
+ direction: options.direction,
4352
4353
  theme: options.theme,
4353
4354
  loading_screen: options.loadingScreen,
4354
4355
  toolbar_bg: options.toolbarBg,
@@ -4431,7 +4432,7 @@ var getChartLocalStorageKey = (suffix, isMobile) => {
4431
4432
  return isMobile ? `orderly_tradingview_mobile_${suffix}` : `orderly_tradingview_${suffix}`;
4432
4433
  };
4433
4434
  var defaultLocale = (localeCode) => {
4434
- return localeCode === "id" ? "id_ID" : localeCode === "tc" ? "zh_TW" : localeCode;
4435
+ return localeCode === "id" ? "id_ID" : localeCode === "tc" ? "zh_TW" : localeCode === "ar" ? "ar" : localeCode === "he" ? "he_IL" : localeCode;
4435
4436
  };
4436
4437
  function useTradingviewScript(props) {
4437
4438
  const {
@@ -4452,6 +4453,7 @@ function useTradingviewScript(props) {
4452
4453
  customIndicatorsGetter
4453
4454
  } = props;
4454
4455
  const localeCode = orderlyI18n.useLocaleCode();
4456
+ const direction = orderlyUi.useDocumentDirection();
4455
4457
  const { isMobile } = orderlyUi.useScreen();
4456
4458
  const { currentTheme } = orderlyUi.useOrderlyTheme();
4457
4459
  const theme = props.theme ?? currentTheme?.mode ?? "dark";
@@ -4684,6 +4686,7 @@ function useTradingviewScript(props) {
4684
4686
  autosize: true,
4685
4687
  symbol: withExchangePrefix(symbol),
4686
4688
  locale: typeof locale === "function" ? locale(localeCode) : locale,
4689
+ direction,
4687
4690
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
4688
4691
  container: chartRef.current,
4689
4692
  libraryPath,
@@ -4798,6 +4801,7 @@ function useTradingviewScript(props) {
4798
4801
  symbol,
4799
4802
  onFullScreenChange,
4800
4803
  classNames,
4804
+ direction,
4801
4805
  fullscreen
4802
4806
  };
4803
4807
  }
@@ -4819,7 +4823,7 @@ var NoTradingview = () => {
4819
4823
  const { t } = orderlyI18n.useTranslation();
4820
4824
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-absolute oui-inset-0 oui-z-0 oui-flex oui-flex-col oui-items-center oui-justify-start oui-p-2 oui-text-base-contrast-80 md:oui-justify-center md:oui-p-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4821
4825
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oui-mb-6 oui-text-xs", children: t("tradingView.noScriptSrc") }),
4822
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oui-mb-3 oui-pl-0 oui-text-2xs oui-text-base-contrast-54 md:oui-pl-2 md:oui-text-base md:oui-text-base-contrast-80", children: /* @__PURE__ */ jsxRuntime.jsx(
4826
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oui-mb-3 oui-ps-0 oui-text-2xs oui-text-base-contrast-54 md:oui-ps-2 md:oui-text-base md:oui-text-base-contrast-80", children: /* @__PURE__ */ jsxRuntime.jsx(
4823
4827
  orderlyI18n.Trans,
4824
4828
  {
4825
4829
  i18nKey: "tradingView.noScriptSrc.1",
@@ -4834,7 +4838,7 @@ var NoTradingview = () => {
4834
4838
  ]
4835
4839
  }
4836
4840
  ) }),
4837
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oui-pl-0 oui-text-2xs oui-text-base-contrast-54 md:oui-pl-2 md:oui-text-base md:oui-text-base-contrast-80", children: /* @__PURE__ */ jsxRuntime.jsx(
4841
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oui-ps-0 oui-text-2xs oui-text-base-contrast-54 md:oui-ps-2 md:oui-text-base md:oui-text-base-contrast-80", children: /* @__PURE__ */ jsxRuntime.jsx(
4838
4842
  orderlyI18n.Trans,
4839
4843
  {
4840
4844
  i18nKey: "tradingView.noScriptSrc.2",
@@ -4855,12 +4859,13 @@ var TopBar = (props) => {
4855
4859
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "top-toolbar oui-flex oui-h-[44px] oui-justify-between md:oui-justify-start oui-items-center oui-p-2 md:oui-px-3 md:oui-pt-3 md:oui-pb-[14px] oui-w-full", children: props.children });
4856
4860
  };
4857
4861
  var topBar_default = TopBar;
4858
- var TradingviewChart = ({ chartRef }) => {
4862
+ var TradingviewChart = ({ chartRef, direction = "ltr" }) => {
4859
4863
  return /* @__PURE__ */ jsxRuntime.jsx(
4860
4864
  "div",
4861
4865
  {
4862
4866
  "data-testid": "tradingview-chart",
4863
4867
  ref: chartRef,
4868
+ dir: direction,
4864
4869
  className: "oui-size-full oui-overflow-hidden"
4865
4870
  }
4866
4871
  );
@@ -5027,13 +5032,15 @@ var TradingviewUI = React3.forwardRef((props, ref) => {
5027
5032
  changeLineType,
5028
5033
  openChartSetting,
5029
5034
  openChartIndicators,
5030
- onFullScreenChange
5035
+ onFullScreenChange,
5036
+ direction = "ltr"
5031
5037
  } = props;
5032
5038
  const { isMobile } = orderlyUi.useScreen();
5033
5039
  return /* @__PURE__ */ jsxRuntime.jsx(
5034
5040
  "div",
5035
5041
  {
5036
5042
  ref,
5043
+ dir: direction,
5037
5044
  className: orderlyUi.cn(
5038
5045
  "oui-tradingview-root oui-relative oui-size-full",
5039
5046
  props.classNames?.root
@@ -5041,6 +5048,7 @@ var TradingviewUI = React3.forwardRef((props, ref) => {
5041
5048
  children: !tradingViewScriptSrc ? /* @__PURE__ */ jsxRuntime.jsx(NoTradingview, {}) : /* @__PURE__ */ jsxRuntime.jsxs(
5042
5049
  "div",
5043
5050
  {
5051
+ dir: direction,
5044
5052
  className: orderlyUi.cn(
5045
5053
  "oui-absolute oui-inset-0 oui-z-[1] oui-flex oui-flex-col",
5046
5054
  props.classNames?.content