Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

8.5 KB
Raw Blame
@import './chat-resource-chips.less';

.answer-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  margin-top: 10px;
  margin-left: -5px;
  min-height: 28px;
  color: color-mix(in srgb, var(--td-text-color-primary) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--app-motion-fast) ease;

  // Quiet outline actions, with a full hit target around each icon.
  :deep(.t-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: color-mix(in srgb, var(--td-text-color-primary) 55%, transparent);
    box-shadow: none;
    transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease;

    .t-button__content {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      gap: 0;
    }

    .t-button__text {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      gap: 0;
    }

    .t-icon, .chat-action-icon {
      display: inline-flex !important;
      visibility: visible !important;
      opacity: 1;
      align-items: center;
      justify-content: center;
      font-size: var(--app-text-xl);
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      color: inherit;
    }

    .t-icon svg {
      display: block !important;
      width: 16px;
      height: 16px;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    &:hover:not(:disabled) {
      background: color-mix(in srgb, var(--td-text-color-primary) 5%, transparent);
      color: var(--td-text-color-secondary);

      .t-icon {
        opacity: 1;
        color: inherit;
      }
    }

    &:active:not(:disabled) {
      background: color-mix(in srgb, var(--td-text-color-primary) 9%, transparent);

      .t-icon {
        opacity: 1;
      }
    }

    &:focus-visible {
      outline: 2px solid var(--td-brand-color-focus);
      outline-offset: 2px;
    }
  }
}

.answer-toolbar--persistent,
.bot_msg:hover :deep(.answer-toolbar),
.bot_msg:focus-within :deep(.answer-toolbar),
.agent-stream-display:hover .answer-toolbar,
.agent-stream-display:focus-within .answer-toolbar {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .answer-toolbar {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-toolbar {
    transition: none;
  }
}

.answer-toolbar__artifact {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.answer-toolbar__artifact.is-arrived {
  animation: artifact-toolbar-arrive 0.7s cubic-bezier(0.22, 1.2, 0.36, 1);
}

.answer-toolbar__artifact.is-collecting .t-button {
  color: var(--td-text-color-placeholder);
  cursor: wait;
}

.answer-toolbar__artifact-spinner {
  animation: wk-spin 0.8s linear infinite;
}

@keyframes artifact-toolbar-arrive {
  0% {
    transform: scale(0.82);
  }

  55% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

.answer-toolbar__artifact-count {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--td-brand-color);
  color: var(--td-text-color-anti);
  font-size: var(--app-text-2xs);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.answer-toolbar__artifact.is-arrived .answer-toolbar__artifact-count {
  animation: artifact-count-arrive 0.7s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes artifact-count-arrive {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }

  60% {
    transform: scale(1.28);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-toolbar__artifact.is-arrived,
  .answer-toolbar__artifact.is-arrived .answer-toolbar__artifact-count {
    animation: none;
  }
}

.answer-toolbar__follow-up-loading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  margin-left: 5px;
  padding-left: 9px;
  border-left: 1px solid var(--td-component-stroke);
  color: var(--td-text-color-placeholder);
  font-size: var(--app-text-sm);
  line-height: 18px;
  white-space: nowrap;

  .t-icon {
    flex: none;
    width: 14px;
    height: 14px;
    font-size: var(--app-text-base);
  }

  .answer-toolbar__follow-up-label {
    background-image: linear-gradient(100deg,
      var(--td-text-color-placeholder) 0%,
      var(--td-text-color-placeholder) 36%,
      var(--td-text-color-primary) 50%,
      var(--td-text-color-placeholder) 64%,
      var(--td-text-color-placeholder) 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: followUpToolbarShimmer 1.5s linear infinite;
    will-change: background-position;
  }
}

@keyframes followUpToolbarShimmer {
  from { background-position: 100% 50%; }
  to { background-position: -100% 50%; }
}

.follow-up-toolbar-loading-enter-active,
.follow-up-toolbar-loading-leave-active {
  transform-origin: left center;
  transition: opacity .16s ease, transform .16s cubic-bezier(.4, 0, .2, 1);
}

.follow-up-toolbar-loading-enter-from {
  opacity: 0;
  transform: translateX(-3px) scale(.92);
}

.follow-up-toolbar-loading-leave-to {
  opacity: 0;
  transform: translate(4px, 3px) scale(.82);
}

@media (prefers-reduced-motion: reduce) {
  .answer-toolbar__follow-up-label {
    animation: none;
    background-image: none;
    color: var(--td-text-color-secondary);
    -webkit-text-fill-color: currentColor;
  }
  .follow-up-toolbar-loading-enter-active,
  .follow-up-toolbar-loading-leave-active { transition: none; }
}

:deep(.streaming-image-loading) {
  display: inline-block;
  position: relative;
  width: clamp(150px, 30vw, 260px);
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--app-radius-lg);
  border: 1px solid rgba(175, 190, 210, 0.55);
  background: linear-gradient(
    145deg,
    rgba(245, 249, 255, 0.72) 0%,
    rgba(228, 236, 248, 0.62) 45%,
    rgba(214, 225, 242, 0.58) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(168, 182, 206, 0.28),
    0 8px 20px rgba(100, 121, 152, 0.12);
  backdrop-filter: blur(3px) saturate(115%);
  -webkit-backdrop-filter: blur(3px) saturate(115%);
  overflow: hidden;
  vertical-align: middle;
  animation: streamingImageBreath 2.2s ease-in-out infinite;
}

:deep(.streaming-image-loading__skeleton) {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(234, 239, 246, 0.95) 8%,
    rgba(248, 250, 252, 0.98) 18%,
    rgba(234, 239, 246, 0.95) 33%
  );
  background-size: 220% 100%;
  animation: streamingImageShimmer 1.4s linear infinite;
}

:deep(.streaming-image-loading)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

:deep(.streaming-image-loading)::after {
  content: '';
  position: absolute;
  left: -35%;
  top: -55%;
  width: 62%;
  height: 210%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.38) 46%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(16deg);
  animation: streamingImageMirror 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes streamingImageShimmer {
  to {
    background-position-x: -220%;
  }
}

@keyframes streamingImageMirror {
  0%, 100% {
    left: -38%;
    opacity: 0.35;
  }
  50% {
    left: 110%;
    opacity: 0.75;
  }
}

@keyframes streamingImageBreath {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
  50% {
    transform: translateY(-0.5px) scale(1.01);
    filter: saturate(1.06);
  }
}

:deep(.streaming-mermaid-loading) {
  display: block;
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 180px;
  margin: 0.75em 0;
  border-radius: 0;
  border: 0;
  background: var(--td-bg-color-container);
  overflow: hidden;
  animation: streamingImageBreath 2.2s ease-in-out infinite;
}

:deep(.streaming-mermaid-loading__skeleton) {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(234, 239, 246, 0.95) 8%,
    rgba(248, 250, 252, 0.98) 18%,
    rgba(234, 239, 246, 0.95) 33%
  );
  background-size: 220% 100%;
  animation: streamingImageShimmer 1.4s linear infinite;
}