Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

3.3 KB
Raw Blame
<div
  class="z-10 right-sidebar border border-solid border-gray-300/80 rounded-lg h-full hidden"
  x-data="rightSidebar()"
  x-bind:style="'width: ' + width"
  id="right-sidebar"
>
  <div class="container flex flex-col h-full">
    <div class="dialog-title">
      <div
        class="right-sidebar-title flex justify-between items-center w-full px-4 py-3"
        role="group"
      >
        <div
          class="title text-basic text-left grow w-full text-v2-gray-darker truncate flex-1 text-2xl flex items-center"
        ></div>

        <div class="flex items-center gap-1">
          <div class="title-left-buttons inline-flex">
            <button
              type="button"
              class="back-btn tooltip-trigger tooltip-pill h-8 w-8 items-center text-sm font-medium text-[#757575] bg-transparent hover:text-gray-100 hover:bg-gray-200 rounded-lg cursor-pointer focus:z-10"
              data-tooltip="Help"
              data-tooltip-position="right"
              aria-label="Help"
            >
              <span class="svg-icon delete"></span>
            </button>
          </div>

          <div class="title-right-buttons inline-flex">
            <button
              type="button"
              class="close-btn relative cursor-pointer w-8 h-8 bg-transparent rounded-lg hover:text-gray-900 hover:bg-gray-100 p-2 focus:z-10"
              aria-label="Close"
            >
              <span class="mif-cross"></span>
            </button>
          </div>
        </div>
      </div>
    </div>
    <div class="dialog-content content flex-grow overflow-y-auto overflow-x-hidden"></div>
    <div class="dialog-actions actions w-full m-0">
      <div
        class="action-buttons w-full h-12 inline-flex justify-end px-0 border-t border-gray-100 border-solid bg-gray-50 m-0 align-middle"
      >
        <div class="action-content w-full flex items-center"></div>
        <button
          type="button"
          class="del-btn tooltip-trigger tooltip-pill relative items-center h-12 p-3 text-sm font-medium bg-transparent focus:z-10 focus:ring-2"
          data-tooltip="Delete Component"
          data-tooltip-position="left"
          aria-label="Delete Component"
        >
          <span class="svg-icon delete h-5 w-5"></span>
        </button>
      </div>
    </div>
  </div>
</div>

<script>
  document.addEventListener('alpine:init', () => {
    Alpine.data('rightSidebar', () => ({
      width: '350px',
      init() {
        this.checkWidth();
        window.addEventListener('sidebarStateChanged', () => {
          const sidebarEl = document.getElementById('right-sidebar');
          if (sidebarEl && sidebarEl.offsetParent !== null) {
            this.checkWidth();
          }
        });
        // Listen for resize events to update width in real-time
        window.addEventListener('rightSidebarResized', (event) => {
          this.width = event.detail.width;
        });
      },
      checkWidth() {
        const DEFAULT_WIDTH = '520px';
        let storedWidth = localStorage.getItem('right-sidebar-common-width') || DEFAULT_WIDTH;

        // Validate width doesn't exceed half screen
        if (parseInt(storedWidth) > window.innerWidth / 2) {
          storedWidth = DEFAULT_WIDTH;
          localStorage.setItem('right-sidebar-common-width', storedWidth);
        }
        this.width = storedWidth;
      },
    }));
  });
</script>